[CLOSED] RatingColumn and ComponentConfig

  1. #1

    [CLOSED] RatingColumn and ComponentConfig

    Hello All,

    I noticed that when I am using RatingColumn then ComponentConfig generates a bit different result. Here is a bit modified code from MVC Examples (Row Expander Plugin with GridPanel):

    public ActionResult GetGrid(string id)
            {
                List<object> data = new List<object>();
                for (int i = 1; i <= 10; i++)
                {
                    data.Add(new { ID = "P" + i, Name = "Product " + i });
                }
    
                GridPanel grid = new GridPanel
                {
                    Height = 200,
                    EnableColumnHide = false,
                    Store = 
                    { 
                        new Store 
                        { 
                            Model = 
                            {
                                new Model {
                                    IDProperty = "ID",
                                    Fields = {
                                        new ModelField("ID"),
                                        new ModelField("Name")
                                    }
                                }
                            },
                            DataSource = data
                        }
                    },
                    ColumnModel =
                    {
                        Columns = 
                        { 
                            new Column { Text = "Products's Name", DataIndex = "Name" },
                            new RatingColumn {Text = "asasas" }
                        }
                    }
                };
    
                return this.ComponentConfig(grid);
            }
    As you see I just added RatingColumn. After this I got the following JSON:

    {'x.res':{},config:"[{store:{model:Ext.define(Ext.id(), {extend: \"Ext.data.Model\", fields:[{name:\"ID\"},{name:\"Name\"}],idProperty:\"ID\" }),autoLoad:true,proxy:{data:[{\"ID\":\"P1\",\"Name\":\"Product 1\"},{\"ID\":\"P2\",\"Name\":\"Product 2\"},{\"ID\":\"P3\",\"Name\":\"Product 3\"},{\"ID\":\"P4\",\"Name\":\"Product 4\"},{\"ID\":\"P5\",\"Name\":\"Product 5\"},{\"ID\":\"P6\",\"Name\":\"Product 6\"},{\"ID\":\"P7\",\"Name\":\"Product 7\"},{\"ID\":\"P8\",\"Name\":\"Product 8\"},{\"ID\":\"P9\",\"Name\":\"Product 9\"},{\"ID\":\"P10\",\"Name\":\"Product 10\"}], type: 'memory'}},height:200,xtype:\"grid\",columns:{items:[{dataIndex:\"Name\",text:\"Products's Name\"},{xtype:\"ratingcolumn\",text:\"asasas\"}]},enableColumnHide:false}]"}
    However, without RatingColumn JSON will be:

    [{store:{model:Ext.define(Ext.id(), {extend: "Ext.data.Model", fields:[{name:"ID"},{name:"Name"}],idProperty:"ID" }),autoLoad:true,proxy:{data:[{"ID":"P1","Name":"Product 1"},{"ID":"P2","Name":"Product 2"},{"ID":"P3","Name":"Product 3"},{"ID":"P4","Name":"Product 4"},{"ID":"P5","Name":"Product 5"},{"ID":"P6","Name":"Product 6"},{"ID":"P7","Name":"Product 7"},{"ID":"P8","Name":"Product 8"},{"ID":"P9","Name":"Product 9"},{"ID":"P10","Name":"Product 10"}], type: 'memory'}},height:200,xtype:"grid",columns:{items:[{dataIndex:"Name",text:"Products's Name"}]},enableColumnHide:false}]
    As you see the format is absolutely different and the first one component loader can't recognize.

    Thanks,
    Alexander
    Last edited by Daniil; Dec 10, 2012 at 4:55 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Config is correct, just i don't see rating column resources. It is bug. Please update from SVN to fix resources issue
  3. #3
    Quote Originally Posted by Vladimir View Post
    Config is correct, just i don't see rating column resources. It is bug. Please update from SVN to fix resources issue
    Thanks for quick fix. It is working perfectly now.

Similar Threads

  1. [CLOSED] event for RatingColumn
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Aug 23, 2012, 9:18 AM
  2. Replies: 2
    Last Post: Oct 07, 2011, 3:55 PM
  3. Replies: 2
    Last Post: Oct 07, 2011, 3:54 PM

Posting Permissions