Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Plumsail add a button to the left side of the toolbar, which will be hidden until an item is selected

fd.spRendered(function() {
    //new button
    var button = {
        text: 'Get info',
        class: 'btn-primary',
        visible: false,
        icon: 'Info',
        iconType: 0,
        click: function() {
            var items = fd.control('SPDataTable1').selectedItems;
            var ids = 'Selected item IDs: ';
            items.forEach(function(item){
              ids += item.ID + '; ';
            });
            alert(ids);
        }
    }

    fd.control('SPDataTable1').ready(function(dt) {
        //dt parameter is the same as fd.control('SPDataTable1')
        dt.buttons.push(button);

        dt.$watch('selectedItems', function(items) {
            if(items.length > 0){
                button.visible = true;
            }
            else{
                button.visible = false;
            }
        });
    });

});
Source by plumsail.com #
 
PREVIOUS NEXT
Tagged: #Plumsail #add #button #left #side #hidden #item #selected
ADD COMMENT
Topic
Name
6+9 =