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

Framework Play

4 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniele
Top achievements
Rank 1
Daniele asked on 24 Mar 2013, 06:07 PM
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 :-( 

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Mar 2013, 09:16 AM
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!
0
Daniele
Top achievements
Rank 1
answered on 27 Mar 2013, 12:37 PM
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

0
Daniele
Top achievements
Rank 1
answered on 27 Mar 2013, 12:39 PM
... - "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. 
0
Atanas Korchev
Telerik team
answered on 27 Mar 2013, 02:29 PM
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!
Tags
Grid
Asked by
Daniele
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Daniele
Top achievements
Rank 1
Share this question
or