Framework Play

5 posts, 0 answers
  1. Daniele
    Daniele avatar
    4 posts
    Member since:
    Apr 2012

    Posted 24 Mar 2013 Link to this post

    Hello I like a lot Kendo UI framework. 
    I work with framework  play 1.2.5 and  I would like to know if it's compatible with your library.
    I catch destroy event from grid, but I can't get the ID :-( 
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 26 Mar 2013 Link to this post

    Hi Danielle,

     We are not sure we understand your question. Please answer the following:

    - Are you using Kendo UI for JSP or just Kendo UI (the jQuery plugins)?
    - What do you mean by "I catch destroy event from grid, but I can't get the ID"? Can you provide your code?

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
  4. Daniele
    Daniele avatar
    4 posts
    Member since:
    Apr 2012

    Posted 27 Mar 2013 Link to this post

    Sure, here there is the code in html 

    //In ${_jsonURLDelete} there is the url of the method

    var ds = new kendo.data.DataSource({
                   transport: {
                       read: {
                           url: '${_jsonURL}', dataType: "json"
                       },
                       destroy: {
                                url: '${_jsonURLDelete}',
                                dataType: "json"
                            },
                            parameterMap: function(options, operation) {
                                if (operation !== "read" && options.models) {
                                    return {models: kendo.stringify(options.models)};
                                }
                            }
                   },
                   schema: {
                            model: {
                                id: "id",
                                fields: {
                                id: { editable: false, nullable: true },
                                    name: { validation: { required: true } },
                                    surname: {  validation: { required: true} },
                                    city:{  validation: { required: true} }
                                }
                            }
                        }
                   
               });


    $("#grid").kendoGrid({
    dataSource: ds,
                    //change: onChange,
    columns : [
    {
       field: "id",
       title: "id"
    },
                       {
                           field: "name",
                           title: "First Name"
                       },
                       {
                           field: "surname",
                           title: "Last Name"
                       },
                       {
                        field: "city",
                        title: "city"
                       },
                       { 
                        command: ["edit", "destroy"], title: " ", width: "190px" 
                       }
                      ],
                          editable: "popup"
    });

    //*************************************
    And here code  in java (method is empty now)..  
    I have no idea, to know the Id of the model for delete, or new data for eventually update method
    //*************************************

       public static void renderClientDelete(Map<String, Object> model)
       {
    Map<String, String[]> val = params.all();
    renderClient();
        }

    thanks a lot for all

  5. Daniele
    Daniele avatar
    4 posts
    Member since:
    Apr 2012

    Posted 27 Mar 2013 Link to this post

    ... - "Are you using Kendo UI for JSP or just Kendo UI (the jQuery plugins)?"

    Now  I use Kendo UI (the jQuery plugins), but I will use, all type of libraries will be necessary. 
  6. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 27 Mar 2013 Link to this post

    Hello Danielle,

     The ID of the destroyed models should be available as argument of the destroy transport configuration. The parameterMap function should convert that data to JSON format. You can try logging what options are given to that function:

    parameterMap: function(options, operation) {
         if (operation == "destroy") {
            console.log(options); // should contain the ID of destroyed items
         }
    }

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET AJAX banner