- Screen name: webJose
webJose's Profile
3 Posts
12 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 04-Oct-2013 10:17 AM
- Forum: Using jQuery UI
Hello everyone. Please have a look at this: http://jsbin.com/IfIVew/2/edit. This is a quick example that I made to illustrate what I need to do and the problem in doing so.In a nutshell, I need to create graphical recursion. Specifically, I created a widget that is applied to a hidden field, which generates two possibilities for the user. One of such possibilities is the ability to add two more hidden fields which in turn allow the same two possibilities, thus creating what I'm calling the "graphical recursion". I need this to create a SQL WHERE clause editor. I'm not discussing the details here but hopefully this is good enough to understand my needs.So back to the example. In here I have 2 "top level" div's. One of these has an internal div that is meant to behave exactly like its parent and the parent's sibling and therefore it becomes the target of the user-defined widget just as well. This works as you can see from the resulting page.Now click the "Here" buttons and count the alerts you see per click. That's right! For top-level DIV's you see only one alert, which is the expected behavior, but for the inner DIV 2 alerts are fired!So the big questions are:- Why is it firing twice in nested widgets?
- How can I prevent multiple firings in nested widgets?
UPDATE: See http://jsbin.com/IfIVew/3/edit, which is a revised version of the example. As you can see, the event is indeed fired in the context of each individual widget in the hierarchy, bottom to top. I added a 4th DIV as a 3rd-level child. The triggering doesn't seem to account for children of the item originally triggering, as expected (just wanted to really verify it, but the behavior was seen already clicking on #test1).- 02-Oct-2013 12:21 PM
- Forum: Using jQuery UI
Hey, I am struggling with refreshing a buttonset because I'm programatically setting a checked item in the underlying radio button. But nevermind that for the time being. Please check this out: http://jsfiddle.net/x3QY3/1/It is a sample that I did NOT do. I found it. If you see the jQuery version used, it is 1.8.3 with jQuery UI 1.9.2. The code works. The Select All button correctly uses prop() to set the checked state of the checkboxes and then calls for a refresh (as individual buttons, which works but I would have used the refresh method of the buttonset instead).Now change the references to jQuery v1.9.1 (and keep jQuery UI 1.9.2). Re-run the example. Now click Select All. Voilá!! Err... I mean damn!! The buttons didn't refresh their state.So what is this problem all about? Is there a fix? I've been writing a widget and will be run under jQuery 1.10.xx and I'm betting the problem is there too. Or is it not? In any case, please volunteer any info you have on this apparent bug. Thanks!UPDATE: Check this one out too: http://jsfiddle.net/didierg/JeFWx/As the only workaround so far that I can find out is to destroy the buttonset and then re-create it.... everytime a programatic selection is made. I'll verify if clicking the button actually sets the checked property of the radio buttons.- 19-Jul-2013 10:26 AM
- Forum: Using jQuery UI
Hello everyone. This one may be a bug of jqGrid, but I should check wit the community first.
To expand on this thread's title, I have a jqGrid, filled via Ajax. One of the columns is currency data (dollar amounts) and I would like this value to be edited via the jQuery UI spinner control. The jqGrid control is set to Form Editing, so as per its documentation I use dataInit of editoptions to run a function that applies the spinner to the standard textbox. Something like this:
- //This is one entry of the colModel array:
- { name: 'AverageOverride', width: 80, editable: true, align: 'right', edittype: 'text', editoptions: { NullIfEmpty: true, dataInit: AvgOverrideSpinner } }
- ...
- //Where AvgOverrideSpinner is this function:
- function AvgOverrideSpinner(elem)
- {
- $(elem).spinner(
- {
- culture: 'en-US'
- , min: 0
- , step: 0.01
- , numberFormat: 'C'
- });
- }
Yes, I am using jQuery.globalize to support the currency format in the spinner. The spinner itself appears and works properly, but the bottom issue here is that the posted form's data doesn't include data for AverageOverride. On the other hand, if I DON'T use a spinner and simply leave a textbox in place, then the posted form's data DOES contain data for AverageOverride. I can easily verify this using the onclickSubmit event in the client side, or in the server side (ASP.net MVC 4) by examining the contents of the form.
Soooo, what do I need? Well, I need resolution. I want to use the spinner AND have its value posted. Am I doing things right here? Is this a known bug, perhaps?
If this were a bug indeed, I am planning on using the change event of the spinner control to set a global JavaScript variable with the spinner's value so it can be picked up by the onclickSubmit event and added to the rest of the data, that is unless you fine fellows can come up with a better solution.
Thanks a lot in advance.
- «Prev
- Next »
Moderate user : webJose
© 2013 jQuery Foundation
Sponsored by and others.

