jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Edit checkbox and dropbox items?
This topic contains 9 replies, has 2 voices, and was last updated by ivailo 10 years ago.
-
Author
-
Hi Team,
I was going through this link and i had few doubts in this.
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/popupediting.htm?classic
As per this link, the edited items would be saved back to the page. My problem is i cannot find how to edit dropdown box and checkbox items. i have dropdown list and checkbox as my columns.
Thanks,
PurnimaHi purnima,
Here is similar example.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivailo,
Thanks for this link. Is there any validation step i can use ?
For e.g. in the above link which you gave, i want to ensure that the first name doesnt contain any numbers. If there are any numbers in it, it should not allow the user to save it in the grid.
I know that we have a validation in the grid section where we mention validation: and then the function here.
Please let me know where i can put validation in the edit feature.
Regards,
PurnimaHi purnima,
You can use jqxValidator. Validate the edit fields like a regular input.
You can see this demo.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivalio,
The validator works well now when i click the edit button. However, i face one problem….
In a field which is set to rule:’required’, i get a message saying that the field is required. When i save the field without entering anything, it allows me to save. The actual scenario should be that it should not allow me if the required field is empty. How can we achieve this ?
i want to also know if there is any rule to check whether only numbers are entered. Input of alphabets and alpha numneric should not be allowed.
There is a rule:’notNumber’… i tried using rule:’number’ to see if only numerical values are accepted. However it doesnt validate for numeric values. How can i modify my rule to achieve this ?Hi Ivalio,
Ok, i got it. I used the onSuccess: function() and then inserted the save function inside this to ensure it is saved only when validation is proper.
Can you please update me regarding validation for input type as number only ????
Hi purnima,
You can create your custom validation rules.
rule: function () { ....... return result; }
Here you can set whatever you want like a condition and then to return boolean result.
In your case to allow only numbers you can use simple Regular Expression.Here is the code.
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comI think the validation code which you posted is wrong. If i enter ‘e111’ as input, it allows it to execute without giving a warning that only numbers should be entered.
Is there a change in regular expression which i need to perform ? pls help…I see what the problem is. It checks for validation of last value.
for e.g. 23grgtfgf4 will not give any error because 4 is the last value and it displayed validation results on basis of that.
can you please let me know wat is the regular expression to check thee entire string. not only the last value.
Hi purnima,
Try this code:
var intRegex = /^\d+$/;
Here is the demo.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.