Class external name

Hi I am trying to create a class external for a component of  DevExtream (of DevExpress.com)
the code for using in asm block is like above.

asm
$(function(){
    $("#gridContainer").dxDataGrid({
        dataSource: [{ ID: 1, CompanyName: "Super Mart of the West"}],
        columns: ["CompanyName", "ID"],
        showBorders: true
    });
});
end;

I am coding in TMSWebCore like

{$modeswitch externalclass}

  TdxDataGrid = class external name 'DevExpress.ui.dxDataGrid'
  public
    datasource : JSValue;
    constructor new;
    function instance : TdxDataGrid;
  end;

But whe I try to use, its rise exception on create with new is not a property of dxDataGrid.

begin
 FdxDataGrid := TdxDataGrid.new;
  FdxDataGrid.datasource := '[{id:1, nome:''Josauro S Jantara''}]';
  FdxDataGrid.instance();
end;

I dont know exact how could use external name for it

Thanks.

Could it be a case-sensitivity on the external mapping? Does DevExtreme use new or New?


Similar constructs are used & working (see web.pas for example)

Example:

var
  Names: TJSObject;
begin
  Names:=TJSObject.new;
end;

with

  TJSObject = class external name 'Object'
  public
    constructor new;

works for example.

I am not sure that what I need to implement to use it in doc I see only like this.



What is there doc saying for creating a new instance from JavaScript?

I think is like this


  • var gridInstance = $("#gridContainer").dxDevGrid("instance");

Have a look at jQWidgets.pas for examples how such control is interfaced

I can not found jqWidgets.pas, this is the exactle name ?

Hi I founded :-) jawidget.pas