1. #1
    Ext User
    Join Date
    Mar 2010
    Posts
    1
    Vote Rating
    0
    namrata.rane is on a distinguished road

      0  

    Default Using Grid Panel : Spring with extjs and JSON

    Using Grid Panel : Spring with extjs and JSON


    I am an extjs newbie and I want to use data returned from a Spring controller in ext-js code to populate a GridPanel. Here is what happens :
    - A page with a form gets submitted
    - Spring MVC controller gets invoked
    - the controller calls the service layer that returns a list
    - this list needs to be displayed on UI using a extjs GridPanel
    - The list is now apart of the model returned from controller

    The question I have is how to access the data from the Spring model object in the ext-js code to define a GridPanel ?

    Here is how I define the GridPanel


    Code:
        
            var myGrid = new Ext.grid.GridPanel({
            store: myStore,
            renderTo: 'myDiv',
            columns: [
                {header: 'UUID', width: 300, sortable: true, dataIndex: 'uniqueId'}
            ],
            stripeRows: true,
            height:350,
            width:350,
            frame:true,
            title: 'List of Unique IDs'
        });
    I understand that the GridPanel would need a datastore. Note that this data store has all the data it needs on the client side, so there is no URL.

    I tried to get the list data in JSON format in a hidden element [listOfUniqueIDs] in the JSP and use it in the datastore like this:

    Code:
        
    var myStore = new Ext.data.JsonStore({
           fields: [
                'uniqueId', 'createdBy'
            ]
            data : Ext.get('listOfUniqueIDs').getAttribute('value')
    });
    But it doesn't seem to get the data and the grid doesn't display anything.


    Any ideas on how to get this data displayed ?

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    try adding autoLoad : true to your data store config

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi