-
20 Dec 2011 1:41 AM #11
Hm, try default name
Work for me.Code:"total":1000,
Try to analyse code from this link
http://extdirectspring.ralscha.ch/demo/simple/
-
20 Dec 2011 1:55 AM #12
I think that I found. Move your total one position above like this
Code:{ "type":"rpc", "tid":1, "action":"QueryEmployee", "method":"readEmployee", "result":{"total":1000,"records":[{"id":"13", <-- put total in result array
-
20 Dec 2011 4:44 PM #13
stbeli: THANK YOU SO MUCH. I got it to work! Damn I actually thought of putting the total inside the 'result' array yesterday too.... but I had to take a break from coding for a while and forgot about it. Many thanks to you guys. This clears up a lot of my questions regarding Ext.direct.
-
20 Dec 2011 5:19 PM #14
So to summarize, I did not need to change my router.php at all. I just needed to change my server-side PHP method to return the results in the correct format like so:
I also had to declare a reader in my store's proxy to tell it the root key of the array containing my results.Code:$results = array(); $results['total'] = $totalResults; $temp_array = array(); $result = $stmt->get_result(); while ($row = $result->fetch_array (MYSQL_ASSOC)) { array_push($temp_array, $row); } $results['records'] = $temp_array; return $results;
Code:reader:{ type: 'json', root: 'records' }
-
21 Dec 2011 1:30 AM #15


Reply With Quote