You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have my full list in the table, no problem. But I've all my records in only one page whereas as you can see, I set the limit to 2. At the end of my table, I've "Displaying records 1 - 2 of 29" whereas I've all my records on the same page and if I want to switch to the second page for example, I've the loading text on the middle, but nothing change.
(Sorry for my bad english, I'm french and i'm learning english everyday :) )
In your case you are using remote dataSource (php page on the server). In this case the paging and sorting needs to be managed on the server side.
You can see a demo for paging and sorting at http://gijgo.com/Grid/Demos/PagingAndSorting
In the demo you can see how I'm passing page and sortBy parameters to the server that control paging and sorting.
Atanas,
Thanks for your answer on my first issue, now it works well.
But, I tried to have the sorting and the pagination options. I followed your example on Gijgo, but it doesn't work.
Here's my code :
$(document).ready(function () {
var data, grid, dialog;
function Save() {
dialog.close();
}
function Edit(e) {
$('#dialog').dialog('open');
}
});
And my server_side_interlocuteur.php :
exec("set names utf8"); $contactId = 'contact'; ``` $_INTERLOCUTEURS_CHAMPS = "I.I_CODE as I_CODE, I.I_CODECONTACT as I_CODECONTACT, I.I_NOM as I_NOM, I.I_PRENOM as I_PRENOM, I.I_TEL1 as I_TEL1, I.I_TEL3 as I_TEL3, I.I_EMAIL as I_EMAIL, I.I_ADRESSE4 as I_ADRESSE4"; // $sOrder = ' order by I.I_NOM, I.I_PRENOM'; $sQuery = "select ".$_INTERLOCUTEURS_CHAMPS." from INTERLOCUTEURFICHE I where I_CODECONTACT = '".StringTools::CleanInjectionFirebird(strtoupper(utf8_decode(trim($contactId))))."' and I.I_INACTIF = 'F' order by I.I_NOM, I.I_PRENOM"; $sth = $dbh->prepare($sQuery); $sth->execute(); $arr = array(); while ($row = $sth->fetch(PDO::FETCH_ASSOC)) { $arr[] = $row; } $sth = $dbh->prepare($sQuery); $sth->execute(); $nb = $sth->fetchAll(); $count = count($nb); $arr = str_replace(" ", "", (json_encode(utf8_encode_recursive($arr)))); $sOutput = ""; $sOutput .= $arr; echo($sOutput); function utf8_encode_recursive ($array) { $result = array(); foreach ($array as $key => $value) { if (is_array($value)) { $result[$key] = utf8_encode_recursive($value); } else if (is_string($value)) { $result[$key] = utf8_encode($value); } else { $result[$key] = $value; } } return $result; } ``` ?>As you can see, i set the Total and i Add it to my Json. It's exactly the same format in your exampe, and it doesn't work for me.
Do you have any idea?
Best regards, and thanks again for your first answer.
Ju,
The text was updated successfully, but these errors were encountered: