EasyUI Forum
September 14, 2025, 10:44:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to get original value after formatter?  (Read 8560 times)
proffl
Newbie
*
Posts: 7


View Profile Email
« on: July 07, 2014, 09:00:16 PM »

 Smiley
if i use $('#pg').propertygrid('getRows')[1].Value it will get value of <span class=' value' ></span> instead of  value.
how to fix the problem?

 Huh Huh Huh Huh
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: July 08, 2014, 12:05: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.
Logged
proffl
Newbie
*
Posts: 7


View Profile Email
« Reply #2 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:
Code:
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:
Code:
$(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:
Code:
$(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+'">&nbsp;</span>';
                     }
                }
            });

        });
but it doesn't work~~~ Cry Cry Cry
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!