Collection property for columns

Can’t make column’s collection property work as stated on the guide for Data Binding and Syncing with Non-UI objects:

$data->render_table(“employees”,“id”,“email, fullname, login”);

:

{ view:“datatable”, id:“dash-ord-active”,…
{ id:“employee”, header:“Employee”, collection:employees},

:

“Two columns for the datatable are fed directly from employees and customers collection where they get text values instead of IDs”

Is datatable id:“employee” mapped to the render_table column “id”?
Which text column from the render_table is displayed instead of the ID?

In the other hand, 20_select_server.html sample shows a different behaviour, using options and collection properties indistinctly for filling editable select/richselect columns with “data/options.json”.

Any help will be appreciated.

When you have { id:"employee in the code, datatable will try to use obj.employee as the column’s values.

If you are using dataConnector , it means you need to have the “employee” field on server side

$data->render_table("employees","id","email, employee, login")

or

$data->render_table("employees","id","email, fullname(employee), login")

or change the config of datatable to { id:"fullname

Sorry, still don’t get it. I think it should work like an inner join right? If so, datatable must supply a key value for looking up into the collection and get some description.

Department data sample:
{“department_id”:90,“department_name”:“Executive”,“manager_id”:100}

var dataDepartments = new webix.DataCollection({
id: “dataDepartments”,
url:“ords->/ords/hr/departments/”, datatype:“ords”

:

Employee data sample:
{“employee_id”:100,“first_name”:“Steven”,“last_name”:“King”,“email”:“SKING”,“department_id”:90}

 

view: “datatable”, id: “datatableEmployees”,
{ id: “department_name”, header: “Department”, collection: dataDepartments }

 

Sadly, the column remains empty even trying with id:“department_id”.

Yes, I confirm that problem exists.
Things works only if in database column have name ‘value’. Than, collection property works well.

Sorry, I have misunderstood the initial question.

Yes, you are right. When you are using some collection, as list of options, it will use the obj.value as text of label.

You can use the scheme configuration, to map some other data field to the obj.value

http://webix.com/snippet/9861611f

Roger that. Id/Value named columns must be in place to make the dataTable options property work right. Thank you guys. I’m sorry for this late retro-feed.