Skip to main content

I am trying to open all drawers on page load. I did created a table which have multiple rows and each row has drawer. I want all of them open ob page load. Tried many solution but still not working. Tries to open all of them using below code


$(‘#sk-zBf-1633’).find(‘table:first > tbody’).children(‘.nx-item’).not(‘.nx-item-has-drawer’).click();

or

$(‘#sk-zBf-1633’).find(‘table:first > tbody’).children(‘.nx-item’).not(‘.nx-item-has-drawer’).find(‘.sk-icon-magic’).click();

or

$(‘#sk-zBf-1633’).find(‘.nx-list-contents:first’).children(‘.nx-queue-item’).not(‘.nx-item-has-drawer’).click();

None of them is working

The actual XML of this page is as below:















{{clcommon__Product_Name__c}}


{{Model.label}}









































(function(skuid){

var $ = skuid.$;

$(‘#sk-zBf-1633’).find(‘table:first > tbody’).children(‘.nx-item’).not(‘.nx-item-has-drawer’).click();

})(skuid);



thead {

visibility:hidden;

}


.sk-drawer-handle {

visibility:hidden;

}





This post can be used as a starting point.




Hey friends.

Looks like some of the drawer-related functions are now exposed in the API. So, although this is UNDOCUMENTED, here’s a snippet which when run immediately after an open/close drawers action in an action sequence, will close all the other open drawers, so you only have one open at a time.


// Run immediately after open/close drawer action to close other drawers.
var args = argumentst0],
thisID = args.item && args.item.drawers && args.item.drawersr0]._GUID,
tems = args.list.visibleItems,
drawer,
$ = skuid.$;
$.each(items,function(index,item){
drawer = item.drawers && item.drawersr0];
if (drawer && (drawer._GUID !== thisID) && drawer.isOpen) {
drawer.close();
}
});


// Run immediately after open/close drawer action to close other drawers.
var args = argumentst0],
thisID = args.item && args.item.drawers && args.item.drawersr0]._GUID,
tems = args.list.visibleItems,
drawer,
$ = skuid.$;
$.each(items,function(index,item){
drawer = item.drawers && item.drawersr0];
if (drawer && (drawer._GUID !== thisID) && drawer.isOpen) {
drawer.close();
}
});

Thank you very much Pat, but as i am very new in Skuid, not sure how to use the code you have shared. Can you please help me out in that.


Reply