Hi ,
How does the math formula get retained across the column. I can see that additional column reference with a math prefix gets associated with the row. But how does this get persisted to the row source so that event notification can make use of this original formula.
Sorry, It is not clear what do you mean.
Are you need a way to store math-based values from the grid, back to the database ?
No , not save values to the database. The math_pref ‘$’ is appended to a row column collection and the math formula [ say e.g. col3 = [$r,col1] -[$r,col2] ] is saved as $col3 ="[$r,col1] -[$r,col2]" . When the values for col1 /col2 are changed, the math value is recomputed by looking at the dummy column created as part of the row. I want to understand how the $col3 is persisted as part of the dataTable, is there a updateItem call somewhere that persists this new column to the row source.
Hi,
Mainly my question is how are the math columns with prefix ‘$’ retained as part of the data collection, I have tried to use some other prefix for a related functionality but I cannot get the prefixed columns to be retained.
Thanks
There is no any special updateItem calls or something similar. You can access the row object and store items on it directly
some.getItem().myProperty = 123;
after such line row object already has new property. updateItem call is necessary only to inform component that related item need to be repainted and maybe saved to the server side. So there is no any tricky rules for custom property setting, you can set any property, with or without a prefix.
Prefix, that used in math has two purposes
- it separates values from normal data, to prevent name conflict
- during data saving components will ignore properties starting from “$” and will not send them to the server side