1. #1
    Sencha User
    Join Date
    Aug 2012
    Location
    Pune, India
    Posts
    78
    Answers
    5
    Vote Rating
    0
    Pravin.Pawar is on a distinguished road

      0  

    Default Unanswered: Changing grid columns dynamically

    Unanswered: Changing grid columns dynamically


    Hi,

    I want to change grid columns dynamically using ExtJS 4.1. Based on certain parameters from the Menu; I have to fetch data from the DB which returns list of the columns which needs to display in grid.

    I have written code to generate dynamic Model in ExtJS and fetching data from AJAX call after Menu item click.

    I tried to recreate grid with new columns somehow the grid is showing all previous columns which were loaded before postback and NOT showing newly created grid columns.

    Please let me know how should I create grid with new columns.
    Thanks, Pravin

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,332
    Answers
    124
    Vote Rating
    83
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    HI!
    you may try to reconfigure your columns.
    grid.reconfigure(store,cols);
    check this:-
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.Panel-method-reconfigure

    S
    ample:-
    Code:
    var mycolumns = [
            { header: 'NameA',  dataIndex: 'name' },
            { header: 'EmailA', dataIndex: 'email', flex: 1 },
            { header: 'ChangeA', dataIndex: 'change', tdCls: 'x-change-cell' }
    ];
    grid.reconfigure(undefined,mycolumns);
    * i have used undefined because, we have to only reconfigure columns,not store.
    check the link, i have given you, you will find there "Either the store or the columns can be omitted".

    Either the store or the columns can be omitted" actually means "Either the store or the columns can be undefined/false/null".
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Location
    Pune, India
    Posts
    78
    Answers
    5
    Vote Rating
    0
    Pravin.Pawar is on a distinguished road

      0  

    Default


    thanks... refreshing columns is working fine... now how to reload store which will bring values of newly added columns in grid?
    Thanks, Pravin

  4. #4
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,332
    Answers
    124
    Vote Rating
    83
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi!

    you may use reload method of your grid's store.

    sample:-
    Code:
     
    YourGrid.getStore().reload()
    also, you may configure the options while reload.

    check this:-
    http://docs.sencha.com/ext-js/4-1/#!...-method-reload
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar