Clear Selection in Javascript and postback.

3 posts, 0 answers
  1. Fergal
    Fergal avatar
    23 posts
    Member since:
    Jun 2012

    Posted 10 Dec 2013 Link to this post

    I'm trying to Clear a RadComboBox in javascript, and have it post back (when AutoPostBack is enabled). I've been searching around for a solution, and this is the best I can come up with - but it feels incredibly hacky - is there a more appropriate method of doing this?

    var combo = $find(comboId);
    combo.hideDropDown();
    combo.trackChanges();
    combo.clearSelection();
    combo.commitChanges();
    var f = { Command: "Select", Index: combo.get_selectedIndex() };
    combo.postback(f);

    Thanks
    Fergal
  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 13 Dec 2013 Link to this post

    Hello Fergal,

    Regarding the clearing of the RadComboBox, the used approach is the correct one. As for having the RadComboBox to artificially fire a postback, this is however consider as a hack, therefore, it is possible to pally the custom approach you are currently using.

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fergal
    Fergal avatar
    23 posts
    Member since:
    Jun 2012

    Posted 13 Dec 2013 Link to this post

    Thanks Nencho, I'll keep using that for now then.
Back to Top