Hello,
I am using customeditortemplate for scheduler. And i have ObjectID as hiiden field and ObjectDescription as text field there like this.
<div data-container-for="ObjectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectDesc, new { @class = "k-textbox" , data_bind = "value:ObjectDesc",style="width:68%;",Name="txtObjDesc"}))
<input class="k-button" id="searchBtn" style="width:20px" type="button" value="...." onclick="TestClick(this)" />
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID",Name="txtObjectID",style="display:none" }))
<span class="k-invalid-msg" data-for="ObjectID"></span>
</div>
When i load scheduler i have lastselected ObjectID and the popup editor must come with ObjectID pre-filled. So this is how my scheduler_edit event looks
function scheduler_edit(e) {
if (e.event.isNew()) {
var rootDir = "@Url.Content("~/")";
var queryStringColl = getQueryStrings();
var objectid = queryStringColl['objectid'];
if (objectid) {
$.ajax({
url: rootDir + "Objekt/LoadAdress",
cache: false,
async: false,
data: {
strSelectedObjectID: objectid
},
success: function (data) {
if (data.result == "Error") {
alert(data.message);
} else {
e.event.set("ObjectDesc", data.objectDesc);
e.event.set("ObjectID", data.objectid);
e.event.set("AdressID", data.AdressID);
e.event.set("contactID", data.ContactID);
e.event.set("LetterHead", data.LetterHead);
}
}
});
}
}
}
When the addwindow comes up i see value for ObjectDesc and rest all but ObjectID is not filled. though objectid has value.
Not sure what is the problem. The ObjectID field is required as well .
Thanks
Anamika
I am using customeditortemplate for scheduler. And i have ObjectID as hiiden field and ObjectDescription as text field there like this.
<div data-container-for="ObjectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectDesc, new { @class = "k-textbox" , data_bind = "value:ObjectDesc",style="width:68%;",Name="txtObjDesc"}))
<input class="k-button" id="searchBtn" style="width:20px" type="button" value="...." onclick="TestClick(this)" />
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID",Name="txtObjectID",style="display:none" }))
<span class="k-invalid-msg" data-for="ObjectID"></span>
</div>
When i load scheduler i have lastselected ObjectID and the popup editor must come with ObjectID pre-filled. So this is how my scheduler_edit event looks
function scheduler_edit(e) {
if (e.event.isNew()) {
var rootDir = "@Url.Content("~/")";
var queryStringColl = getQueryStrings();
var objectid = queryStringColl['objectid'];
if (objectid) {
$.ajax({
url: rootDir + "Objekt/LoadAdress",
cache: false,
async: false,
data: {
strSelectedObjectID: objectid
},
success: function (data) {
if (data.result == "Error") {
alert(data.message);
} else {
e.event.set("ObjectDesc", data.objectDesc);
e.event.set("ObjectID", data.objectid);
e.event.set("AdressID", data.AdressID);
e.event.set("contactID", data.ContactID);
e.event.set("LetterHead", data.LetterHead);
}
}
});
}
}
}
When the addwindow comes up i see value for ObjectDesc and rest all but ObjectID is not filled. though objectid has value.
Not sure what is the problem. The ObjectID field is required as well .
Thanks
Anamika