Default Selection on Popup

  • 2
  • Question
  • Updated 2 years ago
Hello All,

I have a simple use case. I am using a row Actions to popup action. I want some of the records to be by default selected based on the some criteria.

I tried to use javascript but I am not getting Item collection of the popup items..

Any help on this would be hardly appreciated.
Photo of Kinzshah

Kinzshah

  • 110 Points 100 badge 2x thumb
  • Frustrsted

Posted 2 years ago

  • 2
Photo of Hui

Hui

  • 112 Points 100 badge 2x thumb
I'm having the same issue. Calling for help Skuid!
Photo of Matthias

Matthias

  • 628 Points 500 badge 2x thumb
It is really hard to help you with just these few lines.

So a rowaction generally is in context to only the one row it got clicked on. If you want multiple records, you should consider using mass- or global actions depending on your usecase.

for further info about the three different actiontypes, see here:
http://help.skuid.com/m/components/l/102561?data-resolve-url=true&data-manual-id=9861
Photo of Hui

Hui

  • 112 Points 100 badge 2x thumb
Hi Matthias, Kinzhah and I've been working on this together and couldn't figure it out. Please see the images below for more details about our problem:



Photo of Kinzshah

Kinzshah

  • 110 Points 100 badge 2x thumb
@Matthias: Hope Hui's reply has helped you to understand the problem.

Any help here will be highly appreciated.
Photo of Vivek Gupta

Vivek Gupta

  • 378 Points 250 badge 2x thumb
I assume those checkboxes are part of standard skuid table, so i guess achieving this using standard checkboxed would be quite difficult. The other way would be - 

 - Drag the ID column in the child popup 
 - Use custom render. Below is the script to render the id field on the basis of certain business conditions - 

var params = arguments[0],
 $ = skuid.$;

var fieldContainer='';

if(your condition on the bassis of which you want the checkbox to be checked){
    fieldContainer ="<input id='{{{Id}}}' value='{{{Name}}}' type='checkbox' name='anyName' checked=true onclick="+'"' + "AnyFunction("+"'"+params.row.Id+"','"+params.row.Name+"')" +'" />'; 
}
else{
    fieldContainer ="<input id='{{{Id}}}' value='{{{Name}}}' type='checkbox' name='anyName' onclick="+'"' + "AnyFunction("+"'"+params.row.Id+"','"+params.row.Name+"')" +'" />'; 
}
params.element.append(fieldContainer);
Photo of Matthias

Matthias

  • 628 Points 500 badge 2x thumb
Nice Idea Vivek. just keep in mind, that solution will render the ID field, rather than selecting the checkbox on the left of the table, mass actions will not have any context to this row. So if you actually need a mass action, this will not work.