Results 1 to 4 of 4

Thread: Ext.Grid - how to reload it after only defined column is changed?

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    47

    Post Ext.Grid - how to reload it after only defined column is changed?

    I have grid which is loaded wtih this:

    var proxy = new Ext.data.HttpProxy({
    url: 'answer.php?act=load-grid-profiles',
    method: 'post',

    api: {

    read : {url: 'answer.php?act=loadnews&' , method: 'post'},
    create : {url: 'answer.php?act=newnews&id=' , method: 'post'},
    update : {url: answer.php?act=editnews&id=' , method: 'post'},
    destroy : {url: 'answer.php?act=delnews&id=' , method: 'post'}
    }


    });

    All works good. But i have one column (with chackboxes), on which changed i want - full grid be reloaded. Cause when it changes, other records also are affected (only one record can have checked checkbox).

    I try return an variable in json (reload = true) , when

    update : {url: answer.php?act=editnews&id=' , method: 'post'},

    is executed. But dont understood where to analise it is returned.

    Also i try insert in event store.on - update

    store.on({
    'update':{
    fn: function(store, records, options){
    update_manage();

    if ( options == "commit" ) store.reload();
    },
    scope:this
    });

    It reloads, but alter anyone column is updated.

    Pls help me - make it reload grid, after my column named "display" is changed.


    ,Tnx.

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    47

    Default

    Also i try thisway:

    Code:
    // create the editor grid
        var grid = new Ext.grid.EditorGridPanel({
            store: store,
            cm: cm,
            renderTo: '{/literal}{$gridname}{literal}',
            width: 898,
            height: 520,
            frame: true,
            loadMask: true,
            clicksToEdit: 1,
            plugins: [displayColumn],
            listeners:
            {
    
                'cellclick':{
                    fn: function(grid, rowIndex, columnIndex, e) {
                       // Get the Record for the row
                       var record = grid.getStore().getAt(rowIndex);
                       // Get field name for the column
                       var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
                       var data = record.get(fieldName);
    
                       console.info(fieldName, "[cellclick]");
    
                    }
                },
    But cause this cell is from plugin (displayColumn) the event cellclick is not raised on click on this column. All others - yes, it shows that event was, this one - no ...

    ... Arsen

  3. #3
    Sencha User ryanyoungsma's Avatar
    Join Date
    Oct 2008
    Location
    Indialantic, FL
    Posts
    66

    Default

    Are you using a custom plugin for the checkcolumn? did you register an event in this plugin to listen too? Would need to see your column model and plugin code.
    _____________________________________________
    Ryan Youngsma

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    47

    Default

    yes, am using plugin, but i take it from extjs faq (or example)
    Cause it difficult to make this event parser, i
    find out other way - to solve this problem:

    Code:
        // add listener for event 
        proxy.on('write', function( DataProxy, action, data, response, rs, options ) {
    //        console.info( response, "[proxy-on-write]" );
            if ( response.message == "~~~reloading" )
               store.reload();
                
        });
    And this ~~~reloading returns php, which analyses, that only "checkbox" column is updated.
    PHP Code:

       
    if ( isset($p_data_display)  )
          
    $arr_json"message" ] = "~~~reloading";
    ...

     echo 
    json_encode$arr_json );
     exit; 
    Am updating only 1 column a time.

    PS. Not elegant enought ... i know.

Similar Threads

  1. reload datastore with changed parameters
    By ballibum in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 31 Aug 2009, 11:03 AM
  2. How to reload column model in filter grid?
    By romanlutsk in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 29 Jan 2008, 11:07 PM
  3. How to reload a grid after its JsonStore changed?
    By danielking in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 5 Nov 2007, 1:39 AM
  4. Replies: 1
    Last Post: 2 Jun 2007, 8:40 PM
  5. Ext 1.0 Grid Scrollbar Changed
    By griffiti93 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 10 Mar 2007, 11:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •