[CLOSED] Not able to refresh Ext.Net Combobox

  1. #1

    [CLOSED] Not able to refresh Ext.Net Combobox

    Hi Ext.Net Team,

    Here's the scenario

    I have two combobox one is study title and other is scenario they both gets loaded when the MVC view gets load for the first time. Both the combobox are binded using store's datasource. I have a select event on Study Title combox and on its change the scenario should change based on the study title.

    Below is the code:

    X.ComboBoxFor(x => x.ListStudyTitles[0].STUDY_TITLE_CD_STR).ID("CmbStudyTitle")
                                .DisplayField("STUDY_TITLE")
                                .ValueField("STUDY_TITLE_CD_STR")
                                .Store
                                    (
                                        X.Store().ID("StoreStudyTitle")
                                         .Model(
                                                X.Model()
                                                 .Fields(new ModelField("STUDY_TITLE"),
                                                         new ModelField("STUDY_TITLE_CD_STR"))
                                               )
                                         .DataSource(Model.ListStudyTitles)
                                    )
                                .FieldLabel("Study Title").Listeners(ls => { ls.Select.Fn = "ChangeStudyTitleDrp"; })
    
    //Scenario Combo
    X.MultiCombo().ID("CmbScenario").FieldLabel(PR.Resources.RP.RP.RSCmbScenario).LabelCls("fieldLabelTop")
                               .DisplayField("ScenarioName")
                               .ValueField("ScenarioUUID")
                               .CustomConfig(x =>
                                    {
                                        x.Add(new ConfigItem() { Name = "getDisplayValue", Value = "myGetDisplayValue", Mode = ParameterMode.Raw });
                                    }
                               )
                               .Store
                                (
                                        X.Store().ID("StorePrCountry")
                                         .Model(X.Model()
                                                 .Fields(
                                                         new ModelField("ScenarioName"),
                                                         new ModelField("ScenarioUUID")
                                                        )
                                                )
                                        .DataSource(Model.ListExecutedScenarios)
                                )
                               .Listeners(ls => { ls.BeforeRender.Fn = "SetScenarioText"; })
                               .Listeners(ls => { ls.Select.Fn = "SelectScenario"; })
    Jquery Code (Study Tilte Drpdown select event)

    var ChangeStudyTitleDrp = function ()
            {
                var studyTitleCd = App.CmbStudyTitle.getValue();
                Ext.net.DirectMethod.request({
                    url: '@Url.Action("StudyTitleChange", "Results")',
                    params: {
                        studytitleCd: studyTitleCd
                    },
                    success: function (data) {
                        var model = data.m;                 
                        debugger;
                       
                          var store = App.CmbScenario.getStore();
                            store.loadData(model);                     
                        //}
                    },
                    failure: function (result) {
                        Ext.Msg.alert('Error', 'Error Selecting Scenario.');
                    }
                });
            }
    MVC Controller Code:

     public ActionResult StudyTitleChange(int studytitleCd)
            {
                var model = svc.GetRecords();
                return this.Direct(new { m = model });
            }
    The issue is in the javascript debugger i see the new scenario list based on the study title cd. But the Scenario combobox still shows the same records for previous study title cd.

    Can you please direct me what am i doing wrong

    Thanks
    Last edited by Daniil; Sep 20, 2013 at 7:54 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    Please try to set up
    .QueryMode(DataLoadMode.Local)
    for the MultiCombo.

    Does it help?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @PriceRightHTML5team,

    Please try to set up
    .QueryMode(DataLoadMode.Local)
    for the MultiCombo.

    Does it help?
    Awesome its working. Thanks

Similar Threads

  1. [CLOSED] Simulating Combobox refresh
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 29, 2013, 4:11 PM
  2. combobox expand on store refresh
    By ascsolutions in forum 1.x Help
    Replies: 0
    Last Post: Jun 19, 2012, 1:38 PM
  3. [CLOSED] question about combobox refresh
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Jun 18, 2012, 2:02 PM
  4. Refresh combobox in iFrame from TabPanel
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Nov 15, 2009, 3:26 PM
  5. Problem with combobox - On store refresh
    By Kaido in forum 1.x Help
    Replies: 2
    Last Post: Mar 05, 2009, 12:50 PM

Tags for this Thread

Posting Permissions