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

posted data does not reflect user input on popup edit

7 Answers 185 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Giulio
Top achievements
Rank 1
Giulio asked on 22 Jan 2013, 07:33 PM
When i edit my grid using popup editing the value of the 3rd field "Name" is always "" even if i fill the textbox with a value, I noticed that if i put filed "Name" on first position of grid column definition the vallue in the posted data is correct.
If i change editable mode from popup to inline every field is filled correctly.
Did i missed something in the initialization of the grid/datasource?

browser: IE9
Kendo UI: Q3 2012

I've got the following Kendo Grid definition:

$("#grid").kendoGrid({
autoBind:false,
sortable: true,
filterable: true,
columnMenu: true,
height: 400,
columns: [  
{ field: "StoreType", title: "Store Type", editor: StoreTypesDDEditor }, 
{ field: "City", title: "City", editor: CitiesDDEditor }, 
{ field: "Name", title: "Store Name" },
{ field: "Code1" },
{ field: "Code2" },
{ field: "Code3" },
{ command: ["edit", "destroy"], title: " ", width: "200px" }
],
detailTemplate: kendo.template($("#StoreDetailTempl").html()),
detailInit: detailInit,
editable: "popup",
toolbar: [{ name: "create", text: "Add new Store"}],
dataSource: dsStore
});

Definition of DataSource is:

function getStoreDS() {
return new kendo.data.DataSource
({
error : error,
schema: {
data: "d",
model: {
id: "IdStore",
fields: { 
IdStore: { editable: false, nullable: true, type: "numeric" }
Name: { editable: true, type: "string", nullable: false },
IdCity: { editable: true, nullable: true, type: "numeric" },
City: { editable: true, nullable: true, type: "string" },
IdStoreType: { editable: true, nullable: false, type: "numeric" },
StoreType: { editable: true, nullable: false, type: "string" }, 
Code1: { editable: true, nullable: true, type: "string" }, 
Code2: { editable: true, nullable: true, type: "string" }, 
Code3: { editable: true, nullable: true, type: "string" }, 
}
}
},
transport: {
read: { url: "WCF/Store.svc/GetStores", contentType: "application/json; charset=utf-8", type: "POST" },
create: { url: "WCF/Store.svc/AddStore", contentType: "application/json; charset=utf-8", type: "POST" },
update: { url: "WCF/Store.svc/UpdateStore", contentType: "application/json; charset=utf-8", type: "POST" },
destroy: { url: "WCF/Store.svc/DeleteStore", contentType: "application/json; charset=utf-8", type: "POST" },

parameterMap: function(data, operation) {
if (operation != "read") {
data.IdCountry = $("#country").val();
return kendo.stringify({ store: data })
}
else {
//$("#grid").kendoAnimate({ effects: "slide:down fade:out", show: true });
return kendo.stringify({ IdCountry: $("#country").val() })
}
}
}
}); }

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 24 Jan 2013, 07:48 AM
Hi Lorenzo,

Unfortunately, I'm unable to observe such behavior locally. Therefore, it will be appreciated if you could provide a small test page which demonstrates the issue you are facing.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Giulio
Top achievements
Rank 1
answered on 29 Jan 2013, 05:06 PM
Hi, I've arranged a small project attached in this reply. The steps to reproduce the behavior are:
Click Add New button on the toolbar grid fill all the fields in the popup click update, on the parametersMap event of the datasource
you can abserve the data object is not filled correctly.
I noticed this behavior on IE9 and IE9 IE8 compatibility mode, on Firefox 14.0.1 is working as expected.
0
Rosen
Telerik team
answered on 30 Jan 2013, 07:39 AM
Hi Lorenzo,

Thanks for the sample. The described behavior is caused by a known issue with the KendoUI Window widget. Thus, please download the Q3 2012 SP1 version of KendoUI, it should resolve it.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Giulio
Top achievements
Rank 1
answered on 30 Jan 2013, 06:46 PM
Hi Rosen,

I've update my kendo ui version to Q3 2012 SP1 and that solved my problem, I've another issue on the custom popup edit i placed a combobox and wired a changed event to catch the value of ID and Text choosed by the user like below

function CityChanged(e) {

    storeEditModel.IdCity = e.sender.value();
    storeEditModel.City = e.sender.text();
}

the problem is I can get the Value and Text when I write a City not listed only if i press enter, otherwise when the lost fous occur the event is fired  but the value and text are both equals to ""

Can you help me please?
Regards

0
Rosen
Telerik team
answered on 31 Jan 2013, 08:21 AM
Hello Lorenzo,

Could you please take a look at this short video which captures the behavior of a modified version of the previous sample. Maybe I'm missing something obvious.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Giulio
Top achievements
Rank 1
answered on 31 Jan 2013, 04:16 PM
Hi Rosen,

While i was modifing the previous sample I understood that the combo change event does not return text when the fields on the datasorce definition IdCity and City have attribute nullable=false, if I change both of them to true everything works fine, I don't know if this is the behavior expected from a  combobox in a custom popup edit, if not I can supply to you the sample modified to reproduce this behavior otherwise for me it's ok to go ahead setting nullable=true.

I've found some problems on validation with popup edit the tooltips are not positioned correctly, do I have to open another thread?

Regards
0
Accepted
Rosen
Telerik team
answered on 01 Feb 2013, 07:35 AM
Hi Lorenzo,

Indeed, you should open a separate thread for non related to the original topic matters. However, if the issue is that the message appears within the DropDownList, you should check this help topic.

Regards,
Rosen
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
Giulio
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Giulio
Top achievements
Rank 1
Share this question
or