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~~~
