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
JQgrid inside JDIALOG not fetshing data on field change...
06/10/2009
09:58
Avatar
sirshurf
Member
Members
Forum Posts: 43
Member Since:
06/10/2009
sp_UserOfflineSmall Offline

Hi all....

I have a problem...

I have a JQGRID inside UI.DIALOG, the Grid is filled with JSON from URL that have a dinamic value in it filled from an input.

The first time the JQGRID is called all is fine and I am getting my data, but the second time with a different value I am getting the data from previouce call (no refresh in the middle...)

Here is my JS

function jsDialogOpen2(){
    //alert('CustomerAddresses.php?customerNumber='+$("#CustomerNum").val());
   
    //var table = document.getElementById("list22");
    //for(var i = table.rows.length - 1; i > 0; i--)
    //{   
    //    table.deleteRow(i);
    //}
   
   
    gridimgpath = "../styles/images";
    jQuery("#list22").jqGrid({
        datatype: 'json',
        url: 'CustomerAddresses.php?customerNumber='+$("#CustomerNum").val(),  //call CustomerAddresses.php to fill the jQuery
        mtype: 'GET',  
        height: 250,     //table
        fadeIn: 400,
        cache: false,
        rownumbers: true, //view row numbers
        autowidth: true,
        rowNum:10,  //limit record in grid
        rowList:[10,20,30,40,50],
        //scroll: true,
        //scrollrows: true,
        shrinkToFit: true,
        colNames:['Name','Address 1','Address 2', 'City', 'State','Zip','Country Code'],
        colModel:[
             {name:'C1NME',index:'C1NME', width:140},
             {name:'C1AD1',index:'C1AD1', width:100},
             {name:'C1AD2',index:'C1AD2', width:100},
             {name:'C1CITY',index:'C1CITY', width:100},
             {name:'C1STAT',index:'C1STAT', width:100},
             {name:'C1ZIP',index:'C1ZIP', width:100},
             {name:'C1CTR',index:'C1CTR', width:140,align:"right"}
         ],
         pager: jQuery('#pager22'),
         imgpath: gridimgpath,
         multiselect: false,
         onSelectRow: function(id) {
            $("#shipToName").val($("#list22").getCell(id,"C1NME"));
            $("#ShipToAddressLine1").val($("#list22").getCell(id,"C1AD1"));
            $("#ShipToAddressLine2").val($("#list22").getCell(id,"C1AD2"));
            $("#ShipToCity").val($("#list22").getCell(id,"C1CITY"));
            $("#ShipToState").val($("#list22").getCell(id,"C1STAT"));
            $("#ShipToZip").val($("#list22").getCell(id,"C1ZIP"));
            $("#ShipToCountryCode").val($("#list22").getCell(id,"C1CTR"));
            $('#modal2').dialog('close');
        },
      jsonReader : { root: 'rows', page: 'page', total: 'total' , records: 'records' }
  });
  $('#modal2').dialog('open');
 
  
}

on my PHP I have:

    header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
    header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' );
    header ( 'Cache-Control: no-store, no-cache, must-revalidate' );
    header ( 'Cache-Control: post-check=0, pre-check=0', false );
    header ( 'Pragma: no-cache' );

so no caching here too...

Please help...

07/10/2009
02:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

You will need to call GridUnload method before constructing the grid. Something like:

function myfunction()

{

....

jQuery.("#list22").GridUnload();

jQuery.("#list22").jqGrid({...});

jQuery("#modal").dialog("open");

}

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

02/12/2009
17:01
Avatar
sirshurf
Member
Members
Forum Posts: 43
Member Since:
06/10/2009
sp_UserOfflineSmall Offline

Tnanks, but since I dont have a load issue, I desided on a different option...

I am creating the JQGRID always, inside the closed Dialog, and only reloading it dynamicly...

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
51 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