Calling SSJS from within Kendo UI

6 posts, 0 answers
  1. Bryan
    Bryan avatar
    14 posts
    Member since:
    Feb 2016

    Posted 17 Feb 2016 Link to this post

    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?
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 22 Feb 2016 Link to this post

    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!
     
  3. Bryan
    Bryan avatar
    14 posts
    Member since:
    Feb 2016

    Posted 22 Feb 2016 in reply to Nikolay Rusev Link to this post

    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. 

     

  4. Bryan
    Bryan avatar
    14 posts
    Member since:
    Feb 2016

    Posted 22 Feb 2016 in reply to Bryan Link to this post

    I posted in the wrong graphic:

     

     

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 24 Feb 2016 Link to this post

    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!
     
  6. Bryan
    Bryan avatar
    14 posts
    Member since:
    Feb 2016

    Posted 25 Feb 2016 in reply to Nikolay Rusev Link to this post

    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.
Back to Top