Field Renderer is not working (Custom: run a snippet)

  • 1
  • Problem
  • Updated 3 years ago
  • In Progress
I am using (Custom: run a snippet) to render the fields on the skuid pages. It was working till yesterday according to my requirement, all of the sudden it not working now. I believe it's an issue with SKUID. Please look into this.
Photo of Goutham J

Goutham J

  • 568 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
Can you post your snippet?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Goutham, you have not provided enough information for us to provide any support to you. Please let us know the following:

1. Please post the full content of your snippet.
2. Have you changed your snippet's code since yesterday?
3. Have you installed a new version of Skuid since yesterday?
4. Have you removed / changed the names of any fields / objects / Models that may be hard-coded within the Snippet?
Photo of Goutham J

Goutham J

  • 568 Points 500 badge 2x thumb
Renderer for edit read only:

skuid.snippet.registerSnippet('renderer.editReadOnly', function(field,value) {    var $ = skuid.$,
field = arguments[0],
cellElem = field.element,
value = skuid.utils.decodeHTML(arguments[1]);

    cellElem.change(function(newValue) {
        changedRows.push(field.row.Id);
        //field.model.updateRow(field.row, field, newValue);
    })    
    
    skuid.ui.fieldRenderers[field.metadata.displaytype].edit(field,value);
    if(field.required) {
    cellElem.addClass('requiredField');
    }
    return;
});

Renderer for event type: look up for "events".

skuid.snippet.registerSnippet('renderer.EventType.edit', function(field, value) {  var field = arguments[0],
value = skuid.utils.decodeHTML(arguments[1]),
$ = skuid.$;
    
    var eventTypes = [];
    eventTypes.push({
        active: true
        ,defaultValue: true
        ,label : '--None--'
        ,value : ''
    });
    
    skuid.$.each(skuid.model.getModel('EventTypes').getRows(), function(i,row) {
        eventTypes.push({
            active: true
            ,defaultValue: false
            ,label : row.EventTypeName__c
            ,value : row.EventTypeID__c
        });
    });
    
    var customSelect = skuid.ui.renderers.PICKLIST.edit({
        entries : eventTypes,
        required : true,
        value : value
    }).change(function(newValue) {
        var selectedOptions = '';
        for(i = 0; i < newValue.target.selectedOptions.length; i++) {
            //There will only be one selected option since it's rendered as a picklist
            //But I wrote this originally to do something similar with multiselects
            selectedOptions += newValue.target.selectedOptions[i].value;
        }
        console.log('selectedOptions=' + selectedOptions);
        //Update the row in the target object
        field.row[field.id] = selectedOptions;
        //field.model.updateRow(field.row, field, selectedOptions);
    })
    //Append the MULTIPICKLIST to the DOM element
    field.element.append(customSelect).addClass('requiredField');
});

2. I haven't changed the snippet code from yesterday.
3. yeah I have installed the latest version of skuid(4 days back) which has patch 8.
4. I haven't changes any of those.

Here I am attaching the screen shot, It's for creating a new 'Event'
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
What is the expected behavior, and what is the actual behavior? What are the steps to reproduce your issue?
Photo of Goutham J

Goutham J

  • 568 Points 500 badge 2x thumb
Well Zach,
Here the expected behavior is to actually allow the users to enter the values for those fields on this skuid page while creating an 'Event'. Actual behavior is, it's not allowing the user to enter the values. As you can see the above attached screenshot.

Steps to reproduce:
1. create a skuid page, where the models is 'External object' via lightning connect.
2. use the above provided snippet to renderer the fields on the skiud pages.

Please respond ASAP. I have noticed the same issue with couple of other pages also. 
Photo of Goutham J

Goutham J

  • 568 Points 500 badge 2x thumb
Earlier, this is how it used to look.