Sorting By Foreign key Column Text not value in Kendo Grid MVC -
the sorting in mvc kendo grid foreign column sort values not text
the code
@html.kendo().grid( _ of cls.productspecificationm).name("grid").columns( sub(i) i.bound(function(p) p.productspecification_id).hidden(true) i.foreignkey(function(p) p.attribute_id_fk, directcast(viewbag.attributes, system.collections.ienumerable), "attribute_id", "attribute_name").editortemplatename("_attribute_id_fk").title("name") i.foreignkey(function(p) p.attributevalue_id_fk, directcast(viewbag.attributevalues, system.collections.ienumerable), "attributevalue_id", "attributevalue_name").editortemplatename("_attributevalue_id_fk").title("value") i.command(sub(w) w.destroy() end sub) end sub).toolbar(sub(k) k.create() : k.save() end sub).editable(function(e) e.mode(grideditmode.incell)).pageable(function(i) i.input(true).pagesizes({10, 20, 50, 100, 200, 300, 400}).refresh(true)).sortable().filterable().datasource( _ function(p) p.ajax().pagesize(50).batch(true).serveroperation(false).model(sub(i) i.id(function(p2) p2.productspecification_id) i.field(function(p2) p2.item_id_fk).defaultvalue(viewbag.id) i.field(function(p2) p2.attributevalue_id_fk).defaultvalue(1) i.field(function(p2) p2.attribute_id_fk).defaultvalue(1) end sub) _ .read("editinginline_read", "products", new {.id = viewbag.id}) _ .update(function(u) u.action("editinginline_update", "products")) _ .destroy(function(update) update.action("editinginline_destroy", "products")) _ .create(function(update) update.action("editinginline_create", "products"))).events(function(e) e.edit("edit"))
how can sort column text ?
looks kendo doesn't support it. need come other solution.
reponse atanas korchev (admin, kendo ui) can’t support in cases because data source won’t have data (it has foreign key value)
you can use grouping if helps extend. grouping column in kendo
Comments
Post a Comment