Jump to content

TUniDBGrid, editing cell and ajax event


bruno65

Recommended Posts

with a inherited grid from TUniDBGrid, inside a editing cell (type integer) i change the initial value 1 to 3 and tab to the next cell.

Then i do the reverse stage : i change the value 3 to 1.

I added JS log like this 

grdListe.ClientEvents.ExtEvents.Values['beforeedit'] := 'function beforeedit(editor, context, eOpts) { console.log("----------------"); console.log("beforeedit:value="+context.value) }';
grdListe.ClientEvents.ExtEvents.Values['edit'] := 'function edit(editor, context, eOpts) { console.log("edit:originalValue="+context.originalValue); console.log("edit:value="+context.value) }';

For the reverse stage, i check values inside Chrome browser in 2 ways :

  •  with the console panel :

----------------
VM1127:1 beforeedit:value=3
VM1127:1 edit:originalValue=3
VM1127:1 edit:value=1

  • with the network panel , the payload of HandleEvent gives :
  • Ajax=1&IsEvent=1&Obj=O9D3&Evt=beforeedit&V=3&O=3&R=2&C=9&RN=2&_S_ID=VFPzskQn8V10E1BC7DD&_seq_=36
  • Ajax=1&IsEvent=1&Obj=O9D3&Evt=edit&VR=&V=1&O=1&R=2&C=9&RN=2&_S_ID=VFPzskQn8V10E1BC7DD&_seq_=37

I don't find why for the Edit Event O=1 because i expected to be 3 (not 1) like the console log (originalvalue).

Any idea how 'O' can be changed to 1 ?

Note : the consequence is that TUniCustomDBGrid.SetCellValue() will not call SetFldValue() because uniVarsEqual(OldValue, NewValue) is True

Link to comment
Share on other sites

look at the column 'Quantité' in the DBGrid and the events beforeedit and edit

image.png.e2dbaf45eb258c6ebe6780c16afdb3fa.png

image.png.6281c8ff96cb2ebc17450371e29eaaaa.png

then i change the value from 1 to 2 and TAB

image.png.d53b2d6c9abe0013cd070991283e724e.png

image.png.61af3485f86255670e1f8464ecc37d68.png

finally  i change the value from 2 to 1 and TAB

image.png.1bf100abde6aeab4b53ec861d7566a87.png

image.png.866a31b9d96f41519def7c91a7960eef.png

Why the parameter 'O' equals 1 and not 2 ?

Therefore as 'O' = 'V' the data field 'Quantité' won't be updated to 1. ( clicking in an other record then the cell 'Quantité' shows 2)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...