Results 1 to 6 of 6

Thread: 4.2 scrollable infinite grid - store buffer records not updated

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    1
      0  

    Default 4.2 scrollable infinite grid - store buffer records not updated

    version - 4.2 - does anyone know how to update records in the buffer area of store - the issue can be seen in 4.2 example http://docs.sencha.com/ext-js/4-2/ex...w-editing.html you click the active column and only the current view selection of records is checked - if you scroll down the rest of the records are unchecked. looping around store.each(rec to update the record does not mark the records as checked either.

    thanks

  2. #2
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Vote Rating
    257
      0  

    Default

    Not 100% sure I'm following your question just yet; when you click on the column header for the Active column it's sorting that column based on whether the value is checked or not checked (versus it checking or unchecking the rows in that column). Are you wanting to check/uncheck all rows on headerclick?

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    1
      0  

    Default checkcolumn

    I misinterpreted what the example was showing, yes I am wanting to update the buffered store value to checked=true on click of header

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    1
      0  

    Default buffered store updated

    I used the following to update the buffered store:

    for (j=01; j<=grid.store.data.length; j++) {
    var data = grid.store.data.map[j].value;
    for (i=0; i<data.length; i++) {
    data[i].data["constantrowselected"]=true;
    }
    }

    if there is a more efficient way please suggest

  5. #5
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Vote Rating
    257
      0  

    Default

    As to responding to clicks on the header you might look at what the headerclick event offers.
    You might also look at the source code of the Ext.selection.CheckboxModel - specifically the onHeaderClick() method and how it checks the header CSS class to see if it's checked or not and handles the selectAll and deselectAll accordingly.

    To iterate through your store you absolutely can use a loop or you can also use the store's each() method to iterate over your store's records/models. Then for each record you can use the record/model's set() method.

    Code:
    store.each(function (rec) {
        rec.set('constantrowselected', true);
    });

  6. #6
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    29
    Vote Rating
    1
      0  

    Default store.each

    thanks slemmon, I will check out the classes you suggest re. headerClick handling

    re store.each - yes I was using that originally in my code (pre 4.2) but switched to another way of iterating over store records to access the buffered store - since using bufferRenderer (4.2) stopped store.each from working (with err of no data)

    http://www.sencha.com/forum/showthre...)-doesn-t-work

Tags for this Thread

Posting Permissions

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