Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Trouble reloading JSON Data
30/05/2011
17:47
Avatar
Aware
New Member
Members
Forum Posts: 1
Member Since:
30/05/2011
sp_UserOfflineSmall Offline

Hello everybody !

I have trouble reloading my grid.  Here are my snippets (more efficient than a long speech 😉 ) :

$("#gr-recap-table").jqGrid({
            url:'RessourcesController/getContratsOfRessource?id=1',
            datatype: "json",
            mtype: 'GET',
            colNames:['Numéro de contrat', 'Date de début', 'Date de fin', 'Tarif', 'Gratuités', 'Total', 'Société'],
            colModel:[
                      {name:'contrat.numeroContrat', index:'contrat.numeroContrat', align: 'center'},
                      {name:'contrat.dateDebut', index:'contrat.dateDebut', align: 'center'},
                      {name:'contrat.dateFin', index:'contrat.dateFin', align: 'center'},
                      {name:'contrat.tarifJournalier', index:'contrat.tarifJournalier', align: 'center'},
                      {name:'contrat.gratuiteContrat', index:'contrat.gratuiteContrat', align: 'center'},
                      {name:'contrat.montantTotal', index:'contrat.montantTotal', align: 'center'},
                      {name:'contrat.societe.nom', index:'contrat.societe.nom', align: 'center'}
                      ],
                      rowNum:10,
                      rowList:[10,20,30],
                      pager: "#gr-recap-table-pager",
                      //sortname: 'nom',
                      viewrecords: true,
                      sortorder: "desc",
                      caption:"Informations"});

When first loaded, the id of the first object is used to get information (url:'RessourcesController/getContratsOfRessource?id=1',)

Then, in my web page, when a new object is selected by the user, here's what happens :

$.ajax({
                url: "RessourcesController/getContratsOfRessource",
                data: {id: selectedRessource},
                dataType: 'html',
                success: function(data){
                    jQuery("#gr-recap-table").trigger("reloadGrid");
                }
            });

I'm using the id of the new object (selectedRessource) to update my grid .

Everything works but when I reload it ( jQuery("#gr-recap-table").trigger("reloadGrid"); ), my first url is called again (with id=1).

We can see here what's happening :  (first get is irrelevent)

second get is using the good id (=2) and then, when reloading, the first is used again.

Thanks for your help (and sorry for the french picture 😉 )

Here is what happensImage Enlarger

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
156 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information