kendo multiselect for mvc clears the selected values on submit -
my kendo multiselect control displays below clears selected values on page submit. when submit page , contains validations errors, selected items in multiselects lost. though gets fill in httppost method of controller. please me find solution behaviour.
@(html.kendo().multiselectfor(m => m.gemeentesids) .htmlattributes(htmlattrmultiselect) .datatextfield("name") .datavaluefield("id") .placeholder(model.disabled ? "" : "selecteer gemeentes indien van toepassing...") .value(model.gemeentes) .autobind(false) .datasource(source => { source.read(read => { read.action("getgemeentes", "general").data("gemeentefilter").type(httpverbs.post); }) .serverfiltering(false); }) )
controller:
if (model.gemeentesids != null) model.gemeentes = _organisatorischeeenheidrepository.getgemeentesbyids(model.gemeentesids);
try , see if helps. assign name attribute using name() method. in case, think, should gementees. multi-select code like
@(html.kendo().multiselectfor(m => m.gemeentesids)
.name("gemeentes")
.htmlattributes(htmlattrmultiselect) .datatextfield("name") .datavaluefield("id") .placeholder(model.disabled ? "" : "selecteer gemeentes indien van toepassing...") .value(model.gemeentes)
.autobind(false) .datasource(source => { source.read(read => { read.action("getgemeentes", "general").data("gemeentefilter").type(httpverbs.post); }) .serverfiltering(false); })
source link helped me resolve similar issue: http://www.telerik.com/forums/multiselect-and-form-not-sending-values-back
Comments
Post a Comment