jQuery UI Widgets Forums Lists DropDownList DDlist Reset problem.

This topic contains 4 replies, has 2 voices, and was last updated by  darkelf 10 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • DDlist Reset problem. #61847

    darkelf
    Participant

    Hi;
    I use dropdownlist. Bu i have a problem. I have two ddlist in my form. 1) Person, 2) Firm.
    User can select one of them. Sometime user change firm value and select to person. I set to none other value.

    $(‘#inputHKurulus’).on(‘select’, function (event) {
    $(‘#inputHKisi’).jqxDropDownList({selectedIndex: -1}); // Reset to Person
    });

    $(‘#inputHKisi’).on(‘select’, function (event) {
    $(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1}); // Reset to Firm
    }
    This work. But Firm or Person value is not reset. I saw to debuggin : <input type=”hidden” value=”xxxx”/>
    This value is not set to null or -1 or whatever. Keep last value.

    I try to this.
    $(‘#inputHKurulus’).on(‘select’, function (event) {
    $(‘#inputHKisi’).jqxDropDownList({selectedIndex: -1});
    $(‘#inputHKisi input’).val(“”);
    });

    $(‘#inputHKisi’).on(‘select’, function (event) {
    $(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1});
    $(‘#inputHKurulus input’).val(“”);
    });
    After this value is blank like i want. But is not change after select any value.

    Can you help me to fix this? Thanks.

    DDlist Reset problem. #61911

    Dimitar
    Participant

    Hello darkelf,

    What you are trying to achieve is not something that is supported by jqxDropDownList. If you could share what would you like to achieve by doing this, we may be able to provide you with a solution using jqxDropDownList’s supported API.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    DDlist Reset problem. #61928

    darkelf
    Participant

    Hi;
    I think i want to simple. I want to unselect value programmatically. I use this code:

    $(‘#inputHKurulus’).jqxDropDownList({selectedIndex: -1}); // Unselect to value.

    DDListbox’s text changed to “Please Select” but value is not changed. It’s contains to last value. When i post the form i saw this…
    (When I’m inspect the page, i saw <input type=”hidden” value=”xxxx”/> xxx is last value of DDListbox. But DDListbox’s text is “Please Select” at this moment.)

    DDlist Reset problem. #61965

    Dimitar
    Participant

    Hi darkelf,

    Instead of setting selectedIndex to -1 you can try calling the method clearSelection.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    DDlist Reset problem. #62559

    darkelf
    Participant

    It’s work perfect.
    Thanks.

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

You must be logged in to reply to this topic.