javascript - Shield ui wicket datasource -


i'm trying implement shield ui popup editing wicket , java. html , java code:

<div id="grid2"> <script type="text/javascript"> $(document).ready(function () {     $("#grid2").shieldgrid({         datasource: {             /*remote: {                     //read: ""                     //return "leyendo";             },*/             data: "datasource",             schema: {                 fields: {                     id: { path: "id", type: number },                     name: { path: "name", type: string },                     age: { path: "age", type: number },                     birthdate: { path: "birthdate", type: date },                     active: { path: "active", type: boolean }                 }             }         },         paging: {             pagesize: 15         },         rowhover: true,         columns: [            { field: "name", title: "nombre"},             { field: "age", title: "direccion", width: "100px" },             { field: "birthdate", title: "fecha", format: "{0:dd/mm/yyyy}" },             { field: "active", title: "activo", width: "70px" },             {                 width: 150,                 title: "modificar ",                 buttons: [                     { commandname: "edit", caption: "editar" },                     { commandname: "delete", caption: "eliminar" }                 ]             }         ],         editing: {             enabled: true,             mode: "popup",             confirmation: {                 "delete": {                     enabled: true,                     template: function (item) {                         return "eliminar abastecimiento con id '" + item.name + "'?";                     }                 }             }         },         toolbar: [             {                 buttons: [                     { commandname: "insert", caption: "agregar" }                 ],                 position: "top"            }         ]     }); }); </script> </div>   <p></p> </div> 

java's code is:

datasource datasource = new datasource("datasource"); datasourceoptions options = datasource.getoptions();  options.setdata(         new hashmap() {{                   put("id", 1);                   put("name", "item1");                   put("age", 45);                   put("birthdate", "16/08/2006");                   put("active", false);         }},         new hashmap() {{                   put("id", 2);                   put("name", "item2");                   put("age", 45);                   put("birthdate", "16/08/2006");                   put("active", false);         }},         new hashmap() {{                   put("id", 3);                   put("name", "item3");                   put("age", 45);                   put("birthdate", "16/08/2006");                   put("active", false);         }},         new hashmap() {{                   put("id", 4);                   put("name", "item4");                   put("age", 45);                put("birthdate", "16/08/2006");                   put("active", false);         }} );  add(datasource); //end testing shieldui           

there no documentation implementing datasource grid editting i've tried combinations using remote , datat tags in order data may java code. no success.

when deploy war grid whith several rows current date in field birthdata other fields empty.

i dont know data comes, if remove data:"datasource" html file grid headers, no data.

please suggestion grateful.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -