[CLOSED] Set Hide property of Ext control in Javascript with MVC version.

  1. #1

    [CLOSED] Set Hide property of Ext control in Javascript with MVC version.

    Hello,
    In Ext 2.5 version we are using hide() property in javascript to hide an Ext control. But after migration with 4.5.1 same code not working in javascript level.

    E.g. code written at .cshtml
    X.ComboBox()
                .ID("CmbData")
                .AllowBlank(false)
                .Editable(true)
                .ForceSelection(true)
                .QueryMode(DataLoadMode.Local)
                .TriggerAction(TriggerAction.All)
                .EmptyText("-- Select Status --")
                .Items(new ListItem("Active", true),
                new ListItem("Inactive", false))
                );
    Combobox accessed in javascript as below:
      if (Somecondtion==true)
            App.CmbData.show();
        else {
            App.CmbData.hide();
             }
    Note: Server side we are able to hide the control by using Hidden property.
    Last edited by fabricio.murta; Aug 01, 2018 at 12:40 PM.
  2. #2
    Hello @MOHAMMEDRAFI!

    Interesting, this is still the way you should be doing to hide not just combo boxes, but any components in Ext.NET! Client-side speaking, this is also true, according to documentation on combo box's hide() method.

    In fact, the method works if I try it in the combo boxes within the Linked Combo Boxes example in MVC Examples Explorer.

    I can think on some possibilities it is not working for you in your scenario:

    - The context you are using it is not compatible with the hideMode setting you chose, or the default one. So try changing it to the other alternatives and see if they work.
    - You are calling hide() too early during the page load, before the component is actually rendered, so it just does nothing and, when drawn it still has its hidden setting set as false and so it is displayed; if this is the case you can do something like:

    if (App.CmbData.rendered) {
     App.CmbData.hide();
    } else {
     App.CmbData.hidden = true;
    }
    Based on what you provided, that's what I can think of, I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello again, @MOHAMMEDRAFI!

    It's been a while since we last replied your inquiry and didn't hear back from you. Did the thoughts shared in our last response help you identify and fix the issue you were facing? Unfortunately with a full reproduction test case sample, we can't really go much further than guessing.

    We may mark the thread as closed if you do not post a follow-up in 7+ days from now, but we won't lock it up, so you'll still be able to post afterwards.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Thank you. Issue has been resolved. You may close this thread.
  5. #5
    Thanks, the feedback is greatly appreciated!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Feb 08, 2017, 4:31 PM
  2. Replies: 6
    Last Post: Jul 28, 2011, 4:43 PM
  3. [CLOSED] how to set panel html property as javascript property
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 05, 2011, 6:45 PM
  4. [CLOSED] FormPanel - Hide control - label control
    By seanwo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 11, 2010, 8:57 AM

Posting Permissions