Hi Don,
I’m not sure why you’re setting a var as dataprovider, but this is the way I made the checkboxlist:
//1. Create an empty dataset
globals.gFormDS = databaseManager.createEmptyDataSet(0, ['checkbox', 'return_value', 'display_value']);
//2. Loop through your array (or dataset from a query)
var vCheckboxValue = 0, vReturnValue, vDisplayValue;
for(var x in myArray){
vCheckboxValue = myArray[x][0];
vReturnValue = myArray[x][1];
vDisplayValue = myArray[x][2];
globals.gFormDS.addRow(x+1, [vCheckBox, vReturnValue, vDisplayValue]);
}
//3. Create the datasource
var vFormDatasource = globals.gFormDS.createDataSource('multivalueset', [DM_COLUMNTYPE.INTEGER, DM_COLUMNTYPE.INTEGER, DM_COLUMNTYPE.TEXT]);
//4. Create tableview form
var jTableForm = solutionModel.newForm(vDialogTableForm, vFormDatasource, null, false, 330, 200);
jTableForm.view = JSForm.LOCKED_TABLE_VIEW;
jTableForm.scrollbars = SM_SCROLLBAR.HORIZONTAL_SCROLLBAR_NEVER | SM_SCROLLBAR.VERTICAL_SCROLLBAR_AS_NEEDED;
//5. Add checkbox field on form
var jField = jTableForm.newField('checkbox', JSField.CHECKS, 3, 0, 25, 25);
jField.name = 'fld_checkbox'
//6. Add displayValue field
jField = jTableForm.newField('display_value', JSField.TEXT_FIELD, 25, 0, 200, 25);
jField.name = 'fld_display_value'
jField.editable = false;
jField.anchors = SM_ANCHOR.NORTH | SM_ANCHOR.WEST | SM_ANCHOR.EAST;
Then the last part is that you need to decide how you’re going to handle the data changes (when a user selects or deselect a checkbox).
I did that with a Save button on my dialogform, but you also could make an onDataChange method on the checkbox field. Whatever you like.
The reason why I use a global to store the dataset is that you can allways read the -modified- dataset from it, wherever you are in your solution, but maybe this is not nessecary for you.
I hope you are able to create a proper checkboxlist with this example.
I had wanted to drag across to another (initially empty) box
You can find a Drag&Drop sample solution here: http://wiki.servoy.com/display/samples/Sample+solutions. The sample solution will help you understand Drag&Drop functionality in Servoy.