jQWidgets Forums

jQuery UI Widgets Forums Grid Edit checkbox and dropbox items?

Tagged: , ,

This topic contains 9 replies, has 2 voices, and was last updated by  ivailo 10 years ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • Edit checkbox and dropbox items? #73425

    purnima
    Participant

    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,
    Purnima

    Edit checkbox and dropbox items? #73447

    ivailo
    Participant

    Hi purnima,

    Here is similar example.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Edit checkbox and dropbox items? #73477

    purnima
    Participant

    Hi 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,
    Purnima

    Edit checkbox and dropbox items? #73504

    ivailo
    Participant

    Hi purnima,

    You can use jqxValidator. Validate the edit fields like a regular input.
    You can see this demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Edit checkbox and dropbox items? #73588

    purnima
    Participant

    Hi 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 ?

    Edit checkbox and dropbox items? #73590

    purnima
    Participant

    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 ????

    Edit checkbox and dropbox items? #73604

    ivailo
    Participant

    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 Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Edit checkbox and dropbox items? #73722

    purnima
    Participant

    I 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…

    Edit checkbox and dropbox items? #73723

    purnima
    Participant

    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.

    Edit checkbox and dropbox items? #73756

    ivailo
    Participant

    Hi purnima,

    Try this code: var intRegex = /^\d+$/;
    Here is the demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.