I’ve been working with creating dynamic models and components. The tutorial does a good job of showing how it’s done, but the process is repetitive and tedious for creating very little compared to the typical way creating a page.
Can you create utilities for converting models and components into the JS code? It would be very very useful.
Solved
Convert model and component to JS utilities
Best answer by jeanguy_vachon
The code I’m using works fine. It’s the creation of this code that I’d like a utility for.
var allModels = []; var currentTimeEntryModel = new skuid.model.Model(); currentTimeEntryModel.objectName = 'Time_Entry_CB__c'; currentTimeEntryModel.id = 'CurrentTimeEntry'; currentTimeEntryModel.recordsLimit = 1; currentTimeEntryModel.fields = [ { id: 'End_Time__c' }, { id: 'Start_Time__c' }, { id: 'Unique_Time_Entry__c' }, { id: 'Unique_Time_Entry__r.Name' }, ]; currentTimeEntryModel.doQuery = true; currentTimeEntryModel.conditions = [ { enclosevalueinquotes: false, field: 'End_Time__c', inactive: false, name: 'End_Time__c', operator: '=', type: 'blank', value: 'null' } ,{ enclosevalueinquotes: true, field: 'Time_Entry_for__c', inactive: false, mergefield: 'userid', operator: '=', originalInactive: false, type: 'userinfo' } ]; allModels.push(currentTimeEntryModel); // Initialize each of our Models // so that they have index maps created // and other internal guts, // then register them with Skuid // so that Skuid officially knows about them $.each(allModels,function(){ // Register each of our Models with Skuid this.initialize().register(); }); // Load all Models --- this will: // (a) populate all metadata // (b) run the queries on the models skuid.model.load(allModels);<br>
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
