Is it possible set a check box as hidden and also set it to check?

Is it possible set a check box as hidden and also set it to check?

sadamiqbalsadamiqbal Posts: 18Questions: 6Answers: 0

At the moment, i have set my check box as checked by default, by would like not to display it to the user at all. I did do it on open editor event, but the animation shows that the check box is there and then hides it. Do you think this is possible, thank you in advance. Your help will be very much appreciated

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Hi,

    Yes, simply call the hide() method before the form is shown. If you need to do it in a callback then the init events might be of use - i.e. initCreate etc.

    Allan

  • sadamiqbalsadamiqbal Posts: 18Questions: 6Answers: 0
    edited September 2014

    Hello Allan thks for the quick reply, i found a way to get what i need(method 2). Both method 1 and 2 does the same job, but do u know the drawbacks of using method 2? Method 1 seems to be too slow. The animation ruins the UIX. because i do not want the user to know this field exist.

    Thk you in advance for your time and effort Allan

    myEditor.on('preOpen', function (e, json, data)
    {
    myEditor.field(myField).hide() // 1. slow
    this.s.fields.IsAWaypoint.hide(); // 2. efficient and faster way of hiding
    });

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    The second method should not be used as it is using the private and internal s property.

    I would suggest using field().hide() which has an option to disable the animation.

    Allan

This discussion has been closed.