Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: ddgrid get all id's of dd'd records issue with store.each

  1. #1
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default ddgrid get all id's of dd'd records issue with store.each

    Hi guys

    i am using sakis dd grids and its nice works perfect my issue is with the platform.

    i am trying to get the id's of alll the records in the grid that has been altered eg the destination grid, what is happening is no matter how many records i add the first record always comes up as NAN as its record.data.id in the function store.each, take a look

    Code:
    var newPackageMovies;
                                                    
                                                    Ext.getCmp('grid2').getStore().each(function(r){
                                                        newPackageMovies = newPackageMovies + r.data.id + ',';
                                                    });
    
    // RESULT: NaN,2,6,8,4,
    no matter how many i add its always the first one comming up as NaN


    basicaly i need to post this data thats why i am concating a string
    thanks for any suggestions

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    r.data is the Fields. Is there a Field called "id"?

    We need to see your Record def, and your returned JSON.

  3. #3
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    the json is all good i looked throgh it, the record that shows as NaN is of id 1, yes i have the feild there, they are all correct NaN,2,6,8,4,except for the first one in the grid which is not dragged it was there in the first place.

    its there in the JSON the json is box standard i cant put it up here unfortunatly but trust me its box standard and its good generated with zends dojo, it hasent caused probs yet i use it all over with extjs. this is a minute glitch either on my end but maybe on theres.

    the id shows up in teh grid just as same as teh others which do get picked up out of the each loop. , thanks in advance


    noi matter how many i drag they and all the ones that were in teh gridd before show in the record passed to the each loop, except for that very first one which has id of 1.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    The Record may have an ID of 1. Doesn't mean to say that it has a Field which has teh value 1.

    Does it? If you read the docs.

  5. #5
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    Quote Originally Posted by Animal View Post
    The Record may have an ID of 1. Doesn't mean to say that it has a Field which has teh value 1.

    Does it? If you read the docs.
    hold on i think there is an issue with my json lol, brb

  6. #6
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    the json was all good, my colegue deleted some data so i thoght it was wroing, now its all i back in plave the same prob,

    this time instead of r.data.id i used r.data.movie_type, still nothing for the first one, when the records are passed to the each loop the first one is empty.
    NaN,1,1,1,1,

    here is the first line of the firebugged JSON it includes the root and teh identifier both
    of which i have set in php zend dojo, i am now just about to change teh identifier because it may cause issues.

    {"identifier":"id","items":[{"id":1,"movie_type":1,"order":1,"name":"Rambo - The Fight Continues","source_type"

  7. #7
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    last line

    ,"synopsis":null}],"label":"id"}

  8. #8
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    even if i drag the one that dosent show away into teh other grid (teh one with id = 1) it removes it and then makes teh next one that becomes first in teh grid a NaN on all its feilds

    NaN,1,1,1,

  9. #9
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    its got somthing to do with my concating, this alerts them properly i see the id in teh alert box but not in teh srtring.

    Code:
    Ext.getCmp('grid2').getStore().each(function(r){
                                                        alert(r.data.id);
                                                        newPackageMovies = newPackageMovies + r.data.id + ',';
                                                    });

  10. #10
    Sencha User nadeemshafi9's Avatar
    Join Date
    Mar 2009
    Location
    Bucks, Hearts - UK
    Posts
    192

    Default

    FIXED

    Code:
    var newPackageMovies;
                                                    newPackageMovies = '';
                                                    Ext.getCmp('grid2').getStore().each(function(r){
                                                        alert(r.data.id);
                                                        newPackageMovies = newPackageMovies + r.data.id + ',';
                                                    });

Page 1 of 2 12 LastLast

Posting Permissions

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