Skip to Content
avatar image
Former Member

Deselect script for a text box/icon when clicked

Hi everyone,

i have gone through all the posts before posting this question here but couldnt find what i am looking for.

I have a requirement where if i click a text box it filters out the table which is working perfectly fine but the twist here is if we click again that text box it should get the table back to its original form(without any filters).

so after going through various blogs what i found is a script which is for a cross tab -

var l_selectedChar = CT_myCrossTab.getSelectedMember("myCharacteristic");var l_selectedCharKey = l_selectedChar .internalNoncompoundedKey;

if (l_selectedChar.length > 0){/* coding for selected values */}else{/* coding for NO selected values */}


but the problem in the above code is that my text box length will never be 0, so how will it be deselecting the table.

Please help me out with this.

thanks & Regards,

Neetika Singh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 18, 2017 at 02:53 AM

    Define a Global variable at the app level as a flag and value = 0.

    For the text click event check the flag value and write the logic to filter and set the flag to 1 vs remove filter and set flag to 0.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      if i go according to the above method, then when i am clicking on the text box the flag value should change to 1 (which is not changing) and say if it changes then for deselection it should flag value should change back to 0 and i don't understand how will it read that on second "onclick event" it should change the flag value to its original one and remove filter.

      Please correct me if i am wrong somewhere.

      Regards,

      Neetika Singh

  • avatar image
    Former Member
    Oct 25, 2017 at 12:55 PM

    Brian Bernard and Mustafa Bensan, Sir could you please help me on this?

    Regards,

    Neetika Singh

    Add comment
    10|10000 characters needed characters exceeded