[CLOSED] GridPanel ComboBox editor using AjaxProxy: Display blank column MVC

  1. #1

    [CLOSED] GridPanel ComboBox editor using AjaxProxy: Display blank column MVC

    Hi ,
    I found almost same problem (http://forums.ext.net/showthread.php...y-blank-column),
    but my application in MVC.

    Renderer Script

    var MaterialCatergoryRenderer = function (value) {
                
                var r = App.Store_MaterialCatergory.getById(value);
                if (Ext.isEmpty(r)) {
                    return "";
                }
                
                return r.data.CategoryName;
            };
    Store
    X.Store()
            .ID("Store_MaterialCatergory")
            .Model(
                X.Model()
                .IDProperty("MaterialCatergoryID")
                .Fields(
                            X.ModelField()
                           .Name("MaterialCatergoryID")
                           .ServerMapping("MaterialCatergoryID")
                           .Type(ModelFieldType.Int)
                           ,
                           X.ModelField()
                           .Name("CategoryName")
                           .ServerMapping("CategoryName")
                           .Type(ModelFieldType.String)
    
                )
            )
            .AutoLoad(false)
             .Proxy(Html.X().AjaxProxy()
                .Url(Url.Action("../QuotationEntry/Pur_Master_MaterialCategory_Get"))
                .Reader(Html.X().JsonReader().Root("data"))
                
                        )
                                   
               .Listeners(l=>{
                   l.Load.Handler = "App.Store_MaterialCatergory.load();";
                   l.Load.Single = true;
               })             
            //.DataSource(ViewBag.MaterialCatergory)
        )
    Combobox Inside Grid
    X.Column()
                    .DataIndex("MaterialCatergoryID")
                    .Text("Category")
                    .Renderer("MaterialCatergoryRenderer")
                    
                    .Sortable(false)
                    .MenuDisabled(true)
                    .Editor(
                    X.ComboBox()
                    .QueryMode(DataLoadMode.Local)
                    .StoreID("Store_MaterialCatergory")
                    .ValueField("MaterialCatergoryID")
                    .DisplayField("CategoryName")
                    .AllowBlank(false)
                    .SelectOnFocus(true)
                    .SelectOnTab(true)
                   
                    .Triggers(
                    Html.X().FieldTrigger().Icon(TriggerIcon.Clear).Qtip("Remove selected")
                    )
                    .Listeners(l =>
                    {
    
                       
                        l.TriggerClick.Handler = "this.clearValue();";
                        l.Focus.Handler = @"if(this.getValue()==0)
                    {
                        this.clearValue()
                    };";
                    })
                    .EmptyText("Select")
    
                    )
    I do as per Daniil's suggestion ,but not working.
    Last edited by Daniil; Oct 09, 2014 at 7:31 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech,

    I do as per Daniil's suggestion ,but not working.
    It looks you've set up .AutoLoad(false) for the ComboBox's Store. My suggesting was to set it for the GridPanel's ComboBox.

    The idea is - the ComboBox's Store should gets its data before rendering of the GridPanel, because that data is used in the Renderer.
  3. #3
    Hi Daniil,Sorry for that,Its my mistake.I setup properly and now its works,you can close this.

Similar Threads

  1. Replies: 2
    Last Post: Sep 16, 2014, 9:53 PM
  2. Replies: 6
    Last Post: May 02, 2014, 10:25 AM
  3. [CLOSED] Display ComboBox in GridPanel depending on value in other column
    By HansWapenaar in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 14, 2012, 5:16 PM
  4. Replies: 4
    Last Post: Dec 14, 2012, 10:49 AM
  5. Replies: 2
    Last Post: Sep 28, 2011, 8:28 AM

Posting Permissions