Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Documentation bug: custom editing
09/06/2010
02:57
Avatar
vchekan
Member
Members
Forum Posts: 10
Member Since:
07/06/2010
sp_UserOfflineSmall Offline

I'm not sure where to file wkiki bugs, so let me know if there is a better place.

Common Editing properties -> edittype -> custom -> code example

describes function as:

function myvalue(elem)
Which is wrong. This function is called in 2 different scenario: befor submitting data, to get data from custom editor, and before showing custom
editor to poppulate it with data.
Here is what I came up with for my application (can will be different in the wiki example context):

            function sitesGridValue(elem, operation, param) {
                switch (operation) {
                    case 'get':
                        return $("table.ui-jqgrid-btable", elem).getRowData();
                    case 'set':
                        return $("table.ui-jqgrid-btable", elem)[0].addJSONData(JSON.parse(param));
                }
            }
It is crucial to recognize get/set operation, otherwise you will get some unky behavior, for example, custom field does not change
when you navigate forward/backwards.
09/06/2010
03:00
Avatar
vchekan
Member
Members
Forum Posts: 10
Member Since:
07/06/2010
sp_UserOfflineSmall Offline

Something went wrong with code formatting, so reposing my function:

function sitesGridValue(elem, operation, param) {
    switch (operation) {
        case 'get':
            return $("table.ui-jqgrid-btable", elem).getRowData();
        case 'set':
            return $("table.ui-jqgrid-btable", elem)[0].addJSONData(JSON.parse(param));
    }
}
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
40 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information