[CLOSED] [#64] Dynamic DataTable support

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by Vladimir View Post
    Hi,

    DataTable support is added to SVN
    Hi Vladimir, i am aslo looking for this, could you please provide an example or can yo point me to where in svn i can find datatable support example for mvc

    Thanks
    Last edited by Pyropace; Dec 17, 2012 at 3:49 PM.
  2. #12
    Quote Originally Posted by Pyropace View Post
    Hi Vladimir, i am aslo looking for this, could you please provide an example or can yo point me to where in svn i can find datatable support example for mvc

    Thanks
    Hi @Pyropace,

    We don't have such a sample.

    Generally, you just should pass a DataTable instance as a Model.

    You can base on this example.
    http://mvc.ext.net/#/Models/GridPanelFor/

    public ActionResult Index()
    {
        return View(<a DataTable instance>);
    }
  3. #13
    Quote Originally Posted by Daniil View Post
    Hi @Pyropace,

    We don't have such a sample.

    Generally, you just should pass a DataTable instance as a Model.

    You can base on this example.
    http://mvc.ext.net/#/Models/GridPanelFor/

    public ActionResult Index()
    {
        return View(<a DataTable instance>);
    }
    Thanks Daniil. i am doing something in lines of

    i am trying to load an reload a grid based on a datatable that i chosen in a combobox, however i cant get the grid to bind , any hint as where i am going wrong would be greatly appreciated


      Html.X().GridPanelFor(Model.Table)
                             .Title("Data")
                             .ID("DataGrid")
                             .Flex(2)
                             .Disable(true)
                             .ForceFit(true)
                             .View(v => v.Add(new GridView()))
                             .Store(Html.X().Store().AutoLoad(false)
                                        .Model(Html.X().Model().IDProperty("DataGridStore"))
                                        .Proxy(Html.X().AjaxProxy()
                                                           .Url(Url.Action("GetTable"))
                                                           .Reader(Html.X().JsonReader().Root("data")))
                                               .Parameters(ps => ps.Add(new StoreParameter("tableName", "App.comboBoxMethods.getValue()", ParameterMode.Raw)))))))
  4. #14
    You can place a GridPanelFor in a partial view and re-render this partial view on ComboBox Select.
  5. #15
    Danil, not sure what i was doing wrong, but for some reason, GridPanelFor, was giving me an error ( i am under deadline, so i didn't investigate much ) but the way i achieved the something was creating a gridpanel with js and just adding it to the panel place holder

    also, I find Grids to be great, but they are hard to work with, why is it that you have to completely recreate a new grid if your columns changes, is there a way to be able to remove columns and add them again once you have created a grid ? i couldn't find any methods for this on

    http://docs.sencha.com/ext-js/4-1/#!....property.Grid

    either, am i missing something ?

    aslo this is my grid code, just hate to recreate a new grid, every time the structure changes,

    Ext.create("Ext.grid.Panel", {
                id: "GridPanel1",
                renderTo: App.gridContainer.getBody(),
                autoHeight: true,
                ForceFit: true,
                store: {
                    model: Ext.define("DataModel", {
                        extend: "Ext.data.Model",
                        fields: tableFields
                    }),
                    autoLoad: true,
                    proxy: {
                        data: tableValues,
                        type: 'memory',
                        reader: {
                            type: "array"
                        }
                    }
                },
                columns: {
                    items: columns
                }
            });
  6. #16
    Well, you can use a common
    Html.X().GridPanel()
    Also reconfiguring is possible.
    http://mvc.ext.net/#/GridPanel_Colum...Configuration/
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: Apr 12, 2012, 5:44 AM
  2. How to use GridPanel with DataTable
    By kkp0633 in forum 1.x Help
    Replies: 4
    Last Post: Feb 15, 2012, 9:30 AM
  3. DataTable
    By fabiomarcos in forum 1.x Help
    Replies: 0
    Last Post: Nov 08, 2008, 11:24 AM
  4. GridPanel with DataTable?
    By MrMp3 in forum 1.x Help
    Replies: 2
    Last Post: Oct 03, 2008, 4:59 PM

Tags for this Thread

Posting Permissions