Table-Bean 1.4 released

Today we released a new version of the Table-Bean with the following new features:

  • added sortable property: if set to false the table cannot be sorted
  • added textIndent property to control the spacing between the left and right cell border and the text. Defaults to 2 pixels.
  • added setMediaOptionsForColumn(int column, String options, [int width]) to set scaling options for button or media columns
  • the selected row(s) are now preserved after sorting
  • setSelectedIndex now accepts -1 to clear the selection (deselect all selected rows)
  • several bug fixes
    The update is free for registered users and is available from our website.

My onrecordselect doesn’t work?

I want to put my files in a certain directory in the table bean. The idea is to give a preview when someone clicks or hovers a PDF / RTF file.

Now I have the file list, but the onRecordSelect Method doesn’t work and I have done the same as in the Sample solution (I think).

Code:

var test = plugins.file.showDirectorySelectDialog("c:")
var test2  = test.list();

var test3 = databaseManager.convertToDataSet(test2)
elements.datasetGrid.setData(test3, ['Test']);

elements.datasetGrid.bgcolor = '#ffffff';
elements.datasetGrid.selectionBgColor = '#3399ff';
elements.datasetGrid.selectionFgColor = '#000000';
elements.datasetGrid.selectionFont = 'Tahoma,1,11'
elements.datasetGrid.bgcolorEvenRows = '#efefef';
elements.datasetGrid.bgcolorOddRows = '#ccccff';

// Don't show grid lines
elements.datasetGrid.showHorizontalLines = false;
elements.datasetGrid.showVerticalLines = false;

//elements.datasetGrid.setColumnResizable(1, false);
elements.datasetGrid.tableType = 1;
var aa =elements.datasetGrid.setOnRecordSelectionMethod(onRecordSelection);
application.output(aa)

The aa output gives null

setOnRecordSelectionMethod(Function method) is void, meaning it does not return anything. So aa will not receive anything from that call. If you have a look in the status area of the method editor and have clicked on setOnRecordSelection(), you will see a tooltip describing the method and you will also see void. You can always determine from the keyword in front of a method what it does return or that it does not return anything (void).

In the end, you want that your method “onRecordSelection” is called. Now you should make an output in that method like

application.output("onRecordSelection called")

and see if you get that output once you selected a row by clicking on it.

I have an output in that method, but I think it doesn’t even enter the method.

here is the onRecordSelection method:

/*

The method that is set using setOnRecordSelectionMethod

As arguments the row in the dataset or data array and
the data of that row will be returned. If the table is 
sorted some way, the returned row is different from the 
row on screen.

*/

//var vRow = arguments[0],
//	vRowData = arguments[1];

application.output("test" )