How to bind a datatable to array with object properties

I have array of objects where properties are objects it self, how do i bind those.
I want to bind to votes.new
here is the sample
http://webix.com/snippet/7ed2507a

If you do not plan to edit the value, you can use template attribute to define which value will be shown in the column

<div view="column" id="votes.new"  template="#votes.new#

http://webix.com/snippet/3279d4f8

Is there any way to access old value and new value in mark_votes function for formatting. using obj[column]?

$scope.mark_votes = function(value, obj, row, column) {
if (value > 10000)
return { “background-color”: “Green”, color:“white” };
return value;
}

Nope, the object contains only actual value.
You can use something like

webix.ui({
   view:"datatable",
   scheme:{
          $init:function(obj){
                 obj.original = webix.copy(obj);
          } 
   },
   /* normal config here */
});

It will set “original” property for all data items with original item’s value.

This is just for initialization. What if the values are changing by server side events ? is there any function/event i can use to track changes?

when i save object properties to server, it converts value to JSON string - is there a way to post the object?

Sorry I didn’t get this, Please elaborate

Some of my datatable properties are objects as well, but when i save them to the server, webix seems to convert each value to a string. For example, if i have a column that is called “client”, then the resulting JSON POST data is client="{id:1,name:“Client”}" as opposed to the expected client={id:1,name:“Client”}. It is not too much trouble to parse the JSON on the server, but it is causing some trouble and would be better for me if objects were passed untouched.

This is just for initialization.

There are other handlers similar to $init

  • $update - will be triggered if data changed during server side update or client side editing.

if objects were passed untouched.

The ajax transfers only text data, there is no way to transfer complex objects. So client side code need to serialize all js objects to strings

Maybe I’m missing something, so if you know about any other lib that transfer json without serialization - please point me to the related site or article.