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
Inline Edit: Custom Input
12/11/2009
11:49
Avatar
Hannes Käufler
Guest
Guests

Hi Tony!

I´m using the 3.6 only Custom Input in Inline Edit. However, I´m having some trouble with it.

I have two cols sharing the same Custom Input function. But when saving the Row, I get the error

function 'custom_value' undefined via the info_dialog.

I think it triggers the exception because line 119 in grid.inline.js

tmp[nm] = cm.editoptions.custom_value($(".customelement",this));

The jQuery object contains two input elements as I use two of them.
What can I do?
Greetings Hannes
16/11/2009
16:49
Avatar
Hannes Käufler
Guest
Guests

Anybody else noticed that one or am I making a fool out of myself ? 😀

16/11/2009
23:16
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

It seems that you do not have defined the custom_value functio which should return the value from the custom created element. This function should be present in order to work the posting. See the demo What is new in 3.6. and read here :

http://www.trirand.com/jqgridw.....s#edittype

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

17/11/2009
04:11
Avatar
sand123
Member
Members
Forum Posts: 9
Member Since:
20/10/2009
sp_UserOfflineSmall Offline

It's not the same - but in my case:

function myValue(el)
{
    console.dir(el);
}

in colModel:

edittype:'custom',
editoptions:{
    custom_element: myElement,
    custom_value: myValue,   

    value:'1:notebook;2:workstation;3:pocketpc'

},

formatter:'select'

And it creates custom edit (radiobutton group) perfectly - but never calls

myValue()

function - neither when creating new record via add form, nor when editing existing one. In POST thes values are absent

17/11/2009
06:02
Avatar
Hannes Käufler
Guest
Guests

Hi Tony!

This is parts of my ColModel and JS:

{
label: 'Ist-Bewertung',
name: 'pm_stakeholder_subskills.grade',
width: 100, align: 'left', sortable: true, search: false, editable: true,
edittype: 'custom',
editoptions: {
custom_element:rate_input,
custom_value:rate_input_value
},
formatter: rate_input_formatter
}
//
function rate_input(value, options)
{
//do stuff, this works
return $(select_str);
}
// this does not work
function rate_input_value(input)
{
return input.val();
}
As I said, i think I trigger the error because rate_input_value gets passed multiple inputs ( as i have two) and therefor the input.val() fails.
Regards, Hannes
Btw. awesome plugin, we´re using it all the time 🙂

18/11/2009
07:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks for this. I fixed this. The problem was if the value is empty.

The changes are in GitHub.

Please let me know if the fix work.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

18/11/2009
08:42
Avatar
Hannes Käufler
Guest
Guests

Ho tony, thanks alot for the fix.

Have you tested custom input with two custom inputs yet? If I only have one Col with custom input all is great.

But if I have two I get errors.

Additionaly, when I use custom Input I get error when selecting a row, NOT editing, and then selecting another row.

$("td:eq(" + i + ")", ind).html(vl).attr is not a function

[Break on this error] $("td:eq("+i+")",ind).html(vl).attr("title",$.jgrid.stripHtml(vl)); \\r\\n

Greetings

19/11/2009
04:26
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Hannes,

Have tested with two and three custom inputs, but no problems. In order to resolve could you please post the code here or somewhere in the web - I mean jsbin.com.

Thank you

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
95 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