Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

mapping values to a checkbox

I am trying to set checkbox values via a mapping,

This is the gui:

Image

The napping to the two checkbox groups are similar:

Image

Image

The console output:

Image

As you can see from the gui, the single value mapping for 'transmission' works, but the two value one for the 'fueltype' is not mapped.

Can you suggest what is wrong?

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

mapping values to a checkbox

I found a work around, but i am not entirely happy with it,

i removed the mapping to the checkbox group and mapped the same value to all the checkbox items 'checked' value with the following javascript:

this is the js for the fueltype 'petrol' checked mapping:
preconsole.log("get fueltype ", value);
ra = value.split(",");
console.log("ra= ",ra);

for (var fueltype in ra) {
console.log("fueltype = ", ra[fueltype]);
if (ra[fueltype]==='petrol') {
return true;
}
}
return false;/pre

Is there a better way than mapping to each separate checkbox item?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

mapping values to a checkbox

Hello,

Please run a JS code below to set/unset all checkboxes from the checkboxgroup according to the variable=array of values:

pre$("[dsid=mobilecheckboxgroup_10] input").each(function(){
$(this).attr("checked", (arr.indexOf($(this).val()) != -1)).checkboxradio("refresh");
});/pre

here arr - name of the array with values of selected checkboxes

Return to “Issues”