|
Title: propertygrid editor icons from json Post by: jdewilde on July 13, 2015, 06:21:39 AM Hi,
I'm loading the data into my propertygrid from json. It works just fine except the textbox/combobox icon handler, json: {"total":13,"rows":[{"field":"ASSET_ID","name":"ASSET_ID","value":"23274","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_ONDERHOUD_NODIG","name":"Onderhoud nodig","value":"0","group":"Afsluiter info","editor":{"type":"checkbox","options":{"on":"1","off":"0","editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"TYPE","name":"Type","value":"Schuifafsluiter","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"NUMMER","name":"Nummer","value":"4952","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"BIJLETTER","name":"Bijletter","value":"","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_DIAM_CODE","name":"Diameter","value":"080","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"JAAR_AANLEG","name":"Aanlegjaar","value":"2004","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_MERK_CODE","name":"Merk","value":"AVK","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_DRAAIZIN","name":"Draaizin","value":"","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_TOT_TOEREN","name":"Aantal toeren","value":"","group":"Afsluiter info","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"OPMERKING","name":"Opmerking","value":"","group":"Afsluiter info","editor":{"type":"textbox","options":{"multiline":true,"height":100,"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"A_STATUS","name":"<span class='editLabel'>Status</span>","value":"Open","group":"Status","editor":{"type":"combobox","options":{"valueField":"key","textField":"text","data":[{"key":"D","text":"Dicht (definitief)"},{"key":"O","text":"Open"},{"key":"R","text":"Dicht (herstellen breuk)"},{"key":"S","text":"Dicht (spoelen leidingen)"},{"key":"T","text":"Dicht (overkoppelen leiding)"}],"editable":true,"readonly":false,"disabled":false,"iconCls":"icon-edit","icons":[{"iconCls":"icon-add","handler":"OpenAlert"}]}}},{"field":"GEMEENTE","name":"Gemeente","value":"1","group":"Locatie","editor":{"type":"textbox","options":{"editable":false,"readonly":false,"disabled":false,"iconCls":"icon-lock"}}},{"field":"Document 1","name":"Document 1","value":"<a href='http://myserver/gisdoc//AFSLUITERS/DWG/S-DP-0012.dwg' target='_blank'>S-DP-0012.dwg</a>","group":"Documenten"}]} error: Object doesn't support property or method 'call' var _493=tb.find(".textbox-addon"); _493.unbind().bind("click",{target:_48f},function(e){ var icon=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)"); if(icon.length){ var _494=parseInt(icon.attr("icon-index")); var conf=opts.icons[_494]; if(conf&&conf.handler){ conf.handler.call(icon[0],e); opts.onClickIcon.call(_48f,_494); } How can I solve this? What is the syntax I should use in my 'propertygrid json'? thx! Title: Re: propertygrid editor icons from json Post by: stworthy on July 13, 2015, 07:42:44 PM The icon handler on a combobox component must be a function. Please correct your json data and run your page again.
Code: "icons":[{"iconCls":"icon-add","handler":OpenAlert}]Title: Re: propertygrid editor icons from json Post by: jdewilde on July 14, 2015, 03:34:44 AM Thanks for your reply but...
If I do Code: "icons":[{"iconCls":"icon-add","handler":OpenAlert}]if I do Code: "icons":[{"iconCls":"icon-add","handler":"OpenAlert"}] |