Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Plumsail - DataTable Populating Dropdown

fd.spRendered(function() {
    fd.control('DataTable1').$on('edit', function(e) {
        if (e.column.field === 'Category') {
            //pass widget + current Category value
            populateCategories(e.widget, e.model.Category);
        }
    })

});

function populateCategories(widget, value) {
    //will show as loading
    widget._showBusy();

    sp.web.lists.getByTitle('Categories').items
        .select('ID', 'Title')
        .get()
        .then(function(items) {
            //set options
            widget.setDataSource({
                data: items.map(function(i) { return i.Title })
            });

            //set value if one was select
            widget.value(value);
            //hide loading state
            widget._hideBusy();
        });
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: p5.js sketch 
Javascript :: how to set maxLength of input type number in react 
Javascript :: onclick switch javascript 
Javascript :: draw image inside canvas width 100% 
Javascript :: angular resolver with parameters 
Javascript :: js how to shuffle array algoritm. The Fisher-Yates algorith 
Javascript :: js 2 varibale points on same values 
Javascript :: javascript merge modification in objects 
Javascript :: get id of click element within a class list jquery 
Javascript :: React.js setState on page load not working, how to fix 
Javascript :: Examples of correct code for the { "typeof": true } option with global declaration: 
Javascript :: Randomly getting error 500 in Azure App Service when downloading angularjs template 
Javascript :: angularjs Prevent from getting rendered 
Javascript :: angularjs getting Error: [$rootScope:inprog] $digest already in progress when changed from Fetch to $http + $q 
Javascript :: Wait for AngularJS Service to finish running 
Javascript :: Conditional navigation inside Tabs 
Javascript :: how to edit data retrieval using jsp 
Javascript :: adding to an array in js 
Javascript :: Store input values in array javascript 
Javascript :: p5 filter 
Javascript :: Alternative Bind() Syntax For JavaScript 
Javascript :: Printer Errors 
Javascript :: three.js animate object regardless screen fps 
Javascript :: What is an array? Is it static or dynamic in Javascript 
Javascript :: ms dyn crm associate n:m record js 
Javascript :: js a || b 
Javascript :: js how to get random number (inclusive min max) and push it in an array 
Javascript :: regex specific number of characters 
Javascript :: json to dart dummy api 
Javascript :: javascript protect object with proxy 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =