How to create Table from Array Data ?

Hi I’m new to Servoy
I want to create a form with a Table (Grid) where column data are stored in separate arrays. Not taking directly from the DB columns. Also I want to do the common table manipulations such as add row, remove row, select, sort by column etc.

Can I achieve this with Servoy ?

Please tell me a method or an example .

Thank you
:)

Have a look at this thread: http://forum.servoy.com/viewtopic.php?f=1&t=11505&st=0&sk=t&sd=a

hi

Thanks for your reply.

I tried according to that thread. but for the function “ds.createDataSource()” it gave an error saying “Cannot find function createDataSource.”

Please help me on this.

Paste the code you are using and I will have a look at it.

Hi

my above problum was manged to slove.

But I couldnt get the “Table View Locked” view , It comes only the record view

my code as follows

{
var ds = databaseManager.createEmptyDataSet()
ds.addColumn(“price”)
ds.addColumn(“model”)
ds.addRow([1000, ‘BMW’])
ds.addRow([2000, ‘Audi’])
ds.addRow([3000, ‘Peugeot’])

var uri = ds.createDataSource(‘mydata’, [DM_COLUMNTYPE.INTEGER, DM_COLUMNTYPE.TEXT]);

// display_form is a blank form with no table
var myform = solutionModel.getForm(‘display_form’)

myform.dataSource = uri

myform.newField(“price”,SM_DISPLAYTYPE.TEXT_FIELD,100,100,100,20);
myform.newField(“model”,SM_DISPLAYTYPE.TEXT_FIELD,210,100,100,20);

myform.view = SM_VIEW.LOCKED_TABLE_VIEW;

application.showFormInDialog(forms.display_form , 210, 220, 525, 440, “My Form”, false, false, “My Form”, true);

}

Please tell me what should i do to get the Table view.

Thank You

Hi
also I want to assign a value list (combo box) to one of the field. please show me a code sample for achieving
this.
Thanks

Hi,

You say you aren’t getting a tableview. What are you getting instead?

A Record View

And you haven’t viewed the display_form before you altered it’s blueprint using the Solution Model? The new fields you added do show up?

yes,
the display_form is a blank form, the new fields I added show as normal Record view. If i set default navigator to display_form record I can navigate records.

So it is perfectly loks like a form with Record view , but not a Table view as I expected

Caran09:
yes,
the display_form is a blank form, the new fields I added show as normal Record view. If i set default navigator to display_form record I can navigate records.

So it is perfectly loks like a form with Record view , but not a Table view as I expected

This is related to a bug which is now fixed (starting with next release).