Guest User

Untitled

a guest
Jan 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <script type="text/javascript">
  2. {literal}
  3. isc.RestDataSource.create({
  4. ID:"menuItemsDS",
  5. fields:
  6. [
  7. {name:"id",primaryKey:"true",type:"integer", hidden:"true"},
  8. {name:"Title",type:"string",title:"نام"},
  9. {name:"Icon",type:"string",title:"شمایل", length:1500},
  10. {name:"Command",type:"string",title:"فرمان",length:500, hidden:"true"},
  11. {name:"ParentId", type:"integer", title:"منوی پدر"}
  12. ],
  13. dataFormat:"json",
  14. operationBindings:[
  15. {operationType:"fetch", dataProtocol:"getParams"},
  16. {operationType:"add", dataProtocol:"postParams"},
  17. {operationType:"remove", dataProtocol:"postParams", requestProperties:{httpMethod:"DELETE"}},
  18. {operationType:"update", dataProtocol:"postParams", requestProperties:{httpMethod:"PUT"}}
  19. ],
  20. {/literal}
  21. fetchDataURL :"{$this->baseUrl}/{$this->uniqueId}/",
  22. addDataURL :"{$this->baseUrl}/{$this->uniqueId}/",
  23. updateDataURL:"{$this->baseUrl}/{$this->uniqueId}/",
  24. removeDataURL:"{$this->baseUrl}/{$this->uniqueId}/"
  25. });
  26.  
  27. {literal}
  28. var initialCrit = {ParentId:'null'};
  29. var crit = {
  30. criteria:{ fieldName:"ParentId", operator:"isNull"}
  31. };
  32.  
  33. isc.TileGrid.create({
  34. autoDraw:true,
  35. ID:"MenuItems",
  36. tileWidth:150,
  37. tileHeight:150,
  38. height:400,
  39. width:"100%",
  40. showAllRecords:true,
  41. dataSource:"menuItemsDS",
  42. autoFetchData:true,
  43. animateTileChange:true,
  44. initialCriteria:crit,
  45. fields: [
  46. {name:'Title'},
  47. {name:'IconPath', type:'image', imageURLPrefix:"{/literal}{$imageURLPrefix}{literal}"},
  48. {name:'ParentId', type:'integer'}
  49. ]
  50. });
  51. menuItemsDS.fetchData(crit);
  52.  
  53. {/literal}
  54. </script>
Add Comment
Please, Sign In to add comment