Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 03:27:43 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: saving of deleted rows only returns one row  (Read 701 times)
scheppi
Jr. Member
**
Posts: 8


View Profile
« on: September 26, 2011, 05:39:57 AM »

Hello,

i worked into Sigma.Grid since a couple of days now. Everything is working quite fine, but one feature:
I work with remote paging and remote sort functions and when i delete more than one row, only the last deleted row is being sent to the server by the save function. do I have to update all records into the deletedRows Array before sending manually ?

here are my definitions:




as you can see, nothing special.
by the way i also tried first without checkasselected but didn't change anything.
Response (debug-output) attached as screenshot...
« Last Edit: September 26, 2011, 05:44:19 AM by scheppi » Logged
scheppi
Jr. Member
**
Posts: 8


View Profile
« Reply #1 on: September 26, 2011, 05:49:16 AM »

as you can see in the screenshot as a debug-output i first display amount of elements in array {"param"}->{"_gt_json"}[0])->{deletedRecords}, followed by database unique identifier ID.
then i do the same for {"param"}->{"_gt_json"}[0])->{updatedRecords}, but this array has no elements at all.
afterwards i write the sql-query to delete the records and at last the "normal" json output follows.

As i do write my server side code in perl, please do not mind the syntax. it's a bit different to php, but i can read even your php hints.
Logged
scheppi
Jr. Member
**
Posts: 8


View Profile
« Reply #2 on: December 04, 2011, 01:42:22 AM »

As i worked out in the meantime, all arrays in returned dataset always contain only one record. It must be a misconfiguration of the grid.

Now i played around with changing some configs, but as soon as I change recordType from object to array I dont get anymore data into my grid.
Where can I find more information about the different communication depending on recordType option in the dataset variable ?

please help !
Logged
scheppi
Jr. Member
**
Posts: 8


View Profile
« Reply #3 on: December 04, 2011, 08:01:48 AM »

ok, i give in.
whatever i config for recordType : 'object' or recordType : 'array' the only changes are bracket types.
no multiple row-updates are possible.
Logged
Daniel Odulo
Jr. Member
**
Posts: 12



View Profile WWW
« Reply #4 on: March 14, 2012, 12:36:29 PM »

I finally solved this problem, after many hours of research.

The problem comes from setting the uniqueField property on the dsOption.

First off, you have it set incorrectly. You have it set to "no", but that field does not exist in your definition. In your example, it should be set as follows:
uniqueField : "GID"

Second, setting it to field name, in my experience, produced the same problem - only the last modified row would get sent tot he server.

I found 2 workable solution, (in my deployment):
1) Remove uniqueField setting all together.
2) Set it to  unique field index, instead of name. In your example it would be uniqueField : 0

Here's a link to the relevant documentation:
file:///C:/Users/Daniel%20Odulo/Documents/My%20Webs/Sigma%20Grid/sigma_grid2.4_release/docs/sigma_dataset.html#config_fields
Logged

Daniel Odulo
Developer/Architect, Innovator
http://www.Odulo.com/Consulting/
http://www.FlashingPanda.com/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!