Question

Remove all list items added in an editable list view using k2 Rule

  • 30 October 2015
  • 6 replies
  • 10 views

I have a list view and i want to remove all the rows displayed in list view in some event. I have found a rule "remove all the selected rows in editanle list view".But, using this rule we dont find any rule to select all the rows  in list view. Using Clear method on the view, the data cleared from list view still being added in database.

 

So , please help me on this.


6 replies

Hello , 

I think ur problem will be solved if u go to the rule where u use  "remove all the selected rows in editanle list view" , Before that rule u need to add "for each loop" 

u can find it on "Conditions" tab , search for it there and use it before ur rule .

to be speicific again , its on Conditions tab , and editablelist functionality , For each loop , For all items , 

so it will loop all over ur list , and record by record and remove them using ur rule  "remove all the selected rows in editanle list view"

 

best regards

I have used for each loop  for all rows and then added the rule "Remove all the selected rows in editable list view" but this rules do not work for me. The rule needs the rows to be selected by user. Only after that the rows will be removed.

Userlevel 6
Badge +10

Hi,

 

If your records are saved in DB, please make your rule like this:

 

for All rows

       Execute Smartobject Method(Here you execute the delete method and pass the smartobject parameter "ID")

 

Execute list refresh method(make sure to execute this after the loop terminates so it doesn't refresh the list on each iterate)

 

 

wish this helps

Hi,

 

I know this is an old query however I have exactly the same issue.  Unless an item is actually selected by the user then the Remove Selected Row from the Editable List doesnt remove the item (and this will not do all items).  I do not want to use the smartobject option in case the user cancels the updates in which case the data should not be changed in the DB.

 

I can loop through all the rows but i see no way to select the row in order to apply the remove selected row function.

 

Did you manage to get anywhere with this?

 

thanks

I know this is an old topic but there seems to be a need for a different answer.

 

My prefered method is to use View method Clear on the list view in question. That simply clears all the rows in selected list view.

 

Rules -> Actions -> SmartObjectInteractions -> Execute a view method.

 

Hope this helps

Badge
Thank you!! This worked perfectly.

Reply