hello,
i'am a newbie with kendoui and i like it so i have a problem with the defaultvalue when i add a new record.
i have two listview with new record button, the second depends on the first.
When i select one item on the first listview , i filter the second listview like :
dataSourceEnseigne.filter({ field: "idSociete", operator: "eq", value: selected[0]});
this work fine but when click on the add button i have some problem:
$("#addEnseigne").click(function(e) { listViewEnseigne.add(); e.preventDefault(); });
I don't no how to reset the value defaultvalue dynamically
the symptom is :
if no record displayed ==> add operation fail
if one or more record displayed ==> add operation display edit template with value of the first item displayed (like edit function).
after more tests i see that defaultvalue of field must be set to the filter value for this work fine.
What's the method ?
i try :
var data = dataSource1.view(),
selected = $.map(this.select(), function(item) { return data[$(item).index()].idSociete; }); combosocietes.value(selected[0]);
dataSourceEnseigne.filter({ field: "idSociete", operator: "eq", value: selected[0]}); dataSourceEnseigne.options.schema.model.fields.idSociete.defaultValue=selected[0];(don't work)
listViewEnseigne.dataSource.options.schema.model.fields.idSociete.defaultValue=selected[0]; (don't work)
can anyone help me
Thank's for your reply
Phil
i'am a newbie with kendoui and i like it so i have a problem with the defaultvalue when i add a new record.
i have two listview with new record button, the second depends on the first.
When i select one item on the first listview , i filter the second listview like :
dataSourceEnseigne.filter({ field: "idSociete", operator: "eq", value: selected[0]});
this work fine but when click on the add button i have some problem:
$("#addEnseigne").click(function(e) { listViewEnseigne.add(); e.preventDefault(); });
I don't no how to reset the value defaultvalue dynamically
the symptom is :
if no record displayed ==> add operation fail
if one or more record displayed ==> add operation display edit template with value of the first item displayed (like edit function).
after more tests i see that defaultvalue of field must be set to the filter value for this work fine.
What's the method ?
i try :
var data = dataSource1.view(),
selected = $.map(this.select(), function(item) { return data[$(item).index()].idSociete; }); combosocietes.value(selected[0]);
dataSourceEnseigne.filter({ field: "idSociete", operator: "eq", value: selected[0]}); dataSourceEnseigne.options.schema.model.fields.idSociete.defaultValue=selected[0];(don't work)
listViewEnseigne.dataSource.options.schema.model.fields.idSociete.defaultValue=selected[0]; (don't work)
can anyone help me
Thank's for your reply
Phil