Hi
Is it possible to have more than 1 Field Renderer on 1 specific Field?
My use case:
I have a UI-only field with a existing Field Renderer for OnChange handler, and I want to apply the Slider Renderer to that field as well
I tried many combinations and even tried to duplicate fields, and assign 1 field renderer to each, but the onchange handler would not work …
In case useful here are both Snippets
Onchange Handler:
var field = arguments[0], value = arguments[1],
model = field.model,
row = field.row,
$ = skuid.$;
field.element.change(function(){
//some actions after the value of the element has changed
skuid.snippet.getSnippet(‘addDays’)();
});
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);
Slider:
var params = arguments[0], $ = skuid.$;
var field = arguments[0],
value = arguments[1],
$ = skuid.$;
if (field.mode == ‘read’) {
skuid.ui.fieldRenderers.PERCENT.read(field,value);
} else if (field.mode == ‘edit’) {
var amt = $(‘<div class="nx-fieldtext">’)
.text(skuid.ui.renderers.PERCENT.read({ value: value || ‘0’ }));
// Render a jQuery ui slider
// with step size 1 and boundary range [0,10].
// Whenever this slider is updated,
// our row will be updated as well
var slider = $(‘<div>’).slider({
value:value || 0,
min: 1,
max: 100,
step: 1,
slide: function( event, ui ) {
// Update our model with the new value
field.model.updateRow(
field.row,
field.id,
ui.value,
{ initiatorId : field._GUID}
);
amt.text(skuid.ui.renderers.PERCENT.read({ value: ui.value }));
}
});
var sliderContainer = $(‘<div>’).append(amt,slider);
field.element.append(sliderContainer);
}
Thx