VictoriaD
Apprentice

Deselecting a selected item in a SmartForms list view

Seems simple enough but, again, I can't seem to figure out.  How to deselect a selected item in a list view via rules.

0 Kudos
Reply
12 Replies
AhmadAbdullah
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Dear ,

The only way i found to accomplish this request is the following ,

Add a toolbar button or a button ,
Add rules to its click event
1-remove selected row ( which will remove the row as visual row but it will stay in Database )
2- execute view method (refresh list) to refresh the list and get the record back with nothing selected

Hope it helps!
Regards.
0 Kudos
Reply
VictoriaD
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Didn't work.  The rule actually says "remove the selected row from the editable list", does that mean it won't work on a read-only list?  Because my list is read-only.  If so, any other suggestions?

0 Kudos
Reply
AhmadAbdullah
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Dear ,

 

i couldnt find any other way to do that ,

but yes , if u could change the list into editable list it should work , u could just change it into editable list and remove all functionalities u dont need ,

like the tool bar buttons , remove them

and disable/remove on list item double click event ,

doing these things will make it as same as normal list view .

 

Regards.

0 Kudos
Reply
VictoriaD
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Still no joy :( I made the list editable but that rule to remove the selected row still doesn't seem to want to work.  I made a button whose sole purpose is to test that rule and clicking it doesn't do anything.  I'm wondering if the list had to be editable from the start or something silly like that.

0 Kudos
Reply
Latte
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Hi Victoria, 

 

Please explain what you mean by Deselect (or select for that matter). 

 

Do you refer to selecting multiple list items in a K2 list view or do you mean you want to delete rows already existing in a database and displayed in the list view?

 

0 Kudos
Reply
VictoriaD
Apprentice

Re: Deselecting a selected item in a SmartForms list view

When you click on a list view row it becomes highlighted. That is your selected row. Now, how do you deselect it?  In other words, clear a row from being highlighted.

0 Kudos
Reply
Latte
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Hi Victoria, 

 

If you hold the 'Ctrl' key on the keyboard while clicking the row it should be deselected. 

0 Kudos
Reply
VictoriaD
Apprentice

Re: Deselecting a selected item in a SmartForms list view

I am hoping for a solution in rules.

Reply
Latte
Apprentice

Re: Deselecting a selected item in a SmartForms list view

Not sure that's possible with rules, what are you ultimately trying to achieve. There might be another way? Or is it strictly to have a rule deselect specific rows?

 

How will you know which row to deselect? What will trigger the rule?

 

What I have done before is use conditional formatting and actually change colour for every column. So;

  1. User single clicks a row
  2. Back end rule updates a column (maybe status column to selected)
  3. Conditional formatting on all columns changes colour when status = selected. That will make sure every highlighted row has a different colour.

For rows that have different colour (selected rows)

  1. User single clicks
  2. Rule checks if status column = selected, if status = selected, transfer empty string into status column
  3. Default conditional formatting on all columns comes into play and updates column colour back to original value. 

Notes:

  1. When you add the rule to change status, make sure you add a stop rule execution ater the status update. 

Is this close to what you're looking for? Again, if I had a better picture of what you were trying to achieve there might be better suggestions. 

 

0 Kudos
Reply