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_Related Related Topics sp_TopicIcon
custom_value not called correctly when editing row in form
29/08/2013
15:25
Avatar
Torge
Member
Members
Forum Posts: 6
Member Since:
19/07/2010
sp_UserOfflineSmall Offline

Hi,

I created a JSFiddle which illustrates the problem:

http://jsfiddle.net/gznMt/11/

It should override the input value in the edit form with 'bla' but does not do so, as the element passed to custom_value does not seem to exist.

As I already pointed out here: http://www.trirand.com/blog/?p.....038;hellip;..=393#29419

I think the bug is that custom_value is called before the form is attached to the table body.

A workaround seems to be to replace this code in createData:

if($.isFunction(opt.custom_value) && rowid !== "_empty" ) {
     opt.custom_value.call($t, $("#"+nm,"#"+frmgr),'set',tmp);
}

With this:

if($.isFunction(opt.custom_value) && rowid !== "_empty" ) {
     opt.custom_value.call($t, $("#"+nm,tb),'set',tmp);
}

Or am I not getting something? Then please provide me with a fixed JSFiddle :)

Greetings,

         Torge.

Update:
For everyone with the same problem. I found a workaround without patching the jquery code.

custom_value : function(elem, operation, value) {

     if ($(elem).length == 0) return;

     ... Do your stuff ...
}

This works becuase in these cases custom_element already has been called and was able to set the value correctly. In other cases the Form is already attached to the table and the elem object is pointing to it correctly.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 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