asp.net mvc - Kendo MVC Grid ClientTemplate will lead to "Field not defined" -


i have kendo mvc grid read action can done successfully

@(html.kendo().grid<mymodel>()    .name("name")    .autobind(false)    .columns(columns =>    {      ...      columns.bound(c => c.itemcode).clienttemplate("#= itemcode #").title("item").width(300);    })    .pageable(page =>    {      page.enabled(true);    })    .scrollable(s => s.height(400))    .sortable(s => s.enabled(false))    .editable(ed => ed.mode(grideditmode.popup).templatename("materialformeditor").window(w => { w.title(""); w.width(700); }).displaydeleteconfirmation(false))    .datasource(datasource => datasource    .ajax()    .pagesize(20)    .model(model => model.id(p => p.jobno))    .read(read => read.action(...)    .serveroperation(true)    )  )

  public class mymodel      {          public string itemcode;      }

(above code simplified, clienttemplate content field value itself, yet problem still can reproduced)

now problem is, when click "add new record" button, javascript error comes out , no window popped up.

the error said: uncaught referenceerror: itemcode not defined

yet when delete .clienttemplate(), goes right.

what cause of error , how can solve it?


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -