SlickGrid and Kotlin JS


#1

I am trying to manage the SlickGrid   with Kotlin JS project.

I cannot figure out what kotlin JS code can produce correct constructor call.

In pure JS it is

``

var slickgrid = new Slick.Grid(container, rows, columns, options);

constructor in slick.grid.js


(function () {   // Slick.Grid   .extend(true, window, {
  Slick: {
  Grid: SlickGrid
  }
  });

function SlickGrid(container, data, columns, options){…}

}(jQuery));


#2

You need to declare classes and functions in your kotlin code like:

``

native(“Slick.Node”)
class Node

native(“Slick.Options”)
class Options

native(“Slick.Date”)
class Data

native(“Slick.Column”)
class Column

native(“Slick.Grid”)
class Grid(container: Node, data: Array<Data>, columns: Array<Column>, options: Options) {
  // methods and properties
}

fun main(args: Array<String>) {
  val container = Node()
  val data = array(Data())
  val columns = array(Column())
  val options = Options()

  Grid(container, data, columns, options)
}


#3

thanks for you reply. It generate exactly I want.