This is a migrated thread and some comments may be shown as answers.

Calling SSJS from within Kendo UI

5 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 17 Feb 2016, 08:58 PM
I have a lot of code in SSJS libraries that I need to call from within my grids. I have figured out how to get selected documents when a user pushes a button, but now I need to call a method, either in Java or in SSJS. How can I do this?

5 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 22 Feb 2016, 12:43 PM

Hello Bryan,

 

We don't understand what you mean here. Kendo UI is client-side library and essentially it is agnostic on the server-side architecture.

 

How do you call such methods outside the Grid? There shouldn't be any difference in the approach.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 22 Feb 2016, 12:53 PM

I am developing in Xpages, which is based on JSF. 

In my IDE I can write SSJS or CSJS. 

Until I started using Kendo UI generally most things that I wrote were SSJS, 

Probably I am not understanding how to integrate Kendo UI with my data. Everything works fine for loading the data and scrolling through it and paging it and so on. 

But now a user wants to take an action on one or more items in the grid - delete an item, or process an item, or change an item. 

I am able to get the unique identifier for my document and then I want to make a call to the server to take the appropriate action.

So I have a REST call that gets the data for me. And the script for that looks like this:

 

  $("#grid").kendoGrid(
  {
    dataSource: {
      transport: {
        read: "xRest_1.xsp/Users"
      },
      pageSize:20
    },
    height: 550,
    groupable: true,
    sortable: true,
    resizable: true,
    reorderable: true,
    filtertable: true,
    selectable: true,
    dataBound: addExtraStylingToGrid,  // this is where the hover effect function is bound to grid
<!--filterable: {-->
<!--    mode: "row"-->

 

I believe what I need to do is to use something like in the attachment. 

 

0
Bryan
Top achievements
Rank 1
answered on 22 Feb 2016, 07:07 PM

I posted in the wrong graphic:

 

 

0
Nikolay Rusev
Telerik team
answered on 24 Feb 2016, 09:19 AM

Hello Bryan,

 

The Grid, as well as any other data-driven widget, is using DataSource to communicate with the server. It is using jQuery.ajax to make AJAX call to remote-end point (the server).

 

The Grid Editing example demonstrates how editing can be communicated withe the server. Updated models are being send, and the server must response with updated models.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bryan
Top achievements
Rank 1
answered on 25 Feb 2016, 09:11 PM
I think that I understand. Building a complete REST service that returns data for GET,DELETE,PUT,POST etc. Then just hook it into the framework.
Tags
Grid
Asked by
Bryan
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or