Show Posts
|
Pages: [1]
|
3
|
General Category / EasyUI for jQuery / Re: how to get original value after formatter?
|
on: July 08, 2014, 04:46:30 AM
|
The 'getRows' method of propertygrid is inherited from datagrid. It do return the original rows bound to the propertygrid. Please check your propertygrid data carefully.
yes, that's because i've override getValue function. but what can i do if i wanna add formatter to one of my propertygrid row? here is my json: string json = "{\"total\":6,\"rows\":["; json += "{\"name\":\"ID \",\"value\":\"" + ID + "\"}"; json += ",{\"name\":\"Name \",\"value\":\"" + Name + "\",\"editor\":{\"type\":\"validatebox\", \"options\":{\"required\":\"true\"}}}"; json += ",{\"name\":\"Url \",\"value\":\"" + Url + "\",\"editor\":\"text\"}"; json += ",{\"name\":\"Icon \",\"value\":\"" + Icon + "\",\"editor\":{\"type\":\"cbcIcon\",\"options\":{\"valueField\":\"id\",\"textField\":\"name\",\"url\":\"/Icon.aspx\",\"groupField\":\"group\"}}}";
and my javacript code in page: $(document).ready(function () { $('#pg').propertygrid({ url: '/Admin/MenuAdd.aspx?action=sg&id=<%=oldId%>', method: 'get', columns: [[{ field: "name", title: "名称", width: 100 }, { field: "value", title: "值", width: 150 }]] }); });
i've tried some code like below: $(document).ready(function () { $('#pg').propertygrid({ url: '/Admin/MenuAdd.aspx?action=sg&id=<%=oldId%>', method: 'get', columns: [[{ field: "name", title: "名称", width: 100 }, { field: "value", title: "值", width: 150 }]], onLoadSuccess: function(data) { $('#pg').propertygrid('getRows')[3].formatter = function(value) { return '<span class="'+value+'"> </span>'; } } });
});
but it doesn't work~~~ 
|
|
|
5
|
General Category / EasyUI for jQuery / Re: Combobox with pagination
|
on: July 07, 2014, 07:40:27 PM
|
hi, i've tried to add " pagination: true " to combobox, but it doesn't seem work~~` first i add it in json: \"editor\":{\"type\":\"cbcIcon\",\"options\":{\"valueField\":\"id\",\"textField\":\"name\", \"pagination\":\"true\", \"pageSize\":\"5\"}
it doesn't work, so i add it in options: options.pagination = true; options.pageSize = 10; options.pageList = [2, 5, 10, 20];
bad luck, it doesn't work either. can anyone help?
|
|
|
7
|
General Category / EasyUI for jQuery / how to add "formatter" using json?
|
on: July 06, 2014, 03:53:27 AM
|
hi, i'm now using properygrid for editing entity, here is my property json like below: string json = "{\"total\":6,\"rows\":["; json += "{\"name\":\"id\",\"value\":\""+ID+"\"}"; json += ",{\"name\":\"name\",\"value\":\"" + Name + "\",\"editor\":\"text\"}"; json += ",{\"name\":\"path\",\"value\":\"" + Url + "\",\"editor\":\"text\"}"; json += ",{\"name\":\"icon\",\"value\":\"<span class='icon " + Icon + "'> </span>\",\"editor\":{\"type\":\"combobox\",\"options\":{\"valueField\":\"id\",\"textField\":\"name\",\"url\":\"/Icon.aspx\",\"groupField\":\"group\"}}}"; json += "]}";
and i wanna my icon's editor display icon image. instead of text, so i change editors to : \"editor\":{\"type\":\"combobox\",\"options\":{\"valueField\":\"id\",\"textField\":\"name\",\"url\":\"/Icon.aspx\",\"groupField\":\"group\",\"formatter\":\"function(row){brbr}\"}}}"; but it seems javascript take "function(row){brbr}" as string instead of function. how can i add formatter to the editor ?
|
|
|
|