or
!function ($) {
$.extend($.fn, {
busyIndicator: function (c) {
b = $(this);
var d = b.find(
".k-loading-mask"
);
c ? d.length || (d = $(
"<div class='k-loading-mask'><span class='k-loading-text'>Loading...</span><div class='k-loading-image'/><div class='k-loading-color'/></div>"
).width(b.outerWidth()).height(b.outerHeight()).prependTo(b)) : d && d.remove()
}
});
}(jQuery);
function ApprovalSubmit() {
var r = confirm(
"Are you sure you want to submit your approval selection?"
);
if (r == false) {
alert(
'Form NOT submitted'
);
return;
}
ErrorMsgClear();
var qiaComments = $(
'#QiaStatusComments'
).val();
var mainDiv = $(
"#MainDiv"
).closest(
"div.k-window"
);
mainDiv.busyIndicator(true); //
show
if (qiaComments ==
''
) {
mainDiv.busyIndicator(false); //
hide
ErrorMsg(
'Please complete the \'Approver Comments\' before submitting!'
);
/*mainDiv.data("kendoWindow").close();
win.kendoWindow({
refresh: function () { this.center(); }
}).data("kendoWindow")*/
return;
}
var qiaId = $(
'#Id'
).val();
var qiaControl = $(
'#Id'
);
/*var dropdownlist = $("#cmbApprovalSelection");
var dataItem = $('#cmbApprovalSelection option:selected').val();*/
var dataItem = $(
"#cmbApprovalSelection"
);
/*$('#cmbApprovalSelection').val();*/
var approvalSelection = dataItem.val();
/*alert(approvalSelection + '-' + dataItem.dataTextField + '-' + dataItem.dataValueField + '-' + dataItem.val());*/
if (approvalSelection == null || approvalSelection ==
''
) {
mainDiv.busyIndicator(false); //
hide
ErrorMsg(
'Please select approval value from drop down list below!'
);
/*mainDiv.data("kendoWindow").close();
mainDiv.kendoWindow({
visible: false
}).data("kendoWindow").center().open();*/
return;
}
else {
$(
'#btnApproverSelection'
).
hide
();
$.ajax({
type:
"POST"
,
async: true,
contentType:
"application/json;charset=utf-8"
,
url:
"@Url.Action("
ApproverSelection
", "
Home
")"
,
data:
'{ "id":'
+ qiaId +
', "approverSelection":"'
+ approvalSelection +
'", "comments":"'
+ qiaComments +
'" }'
,
dataType:
"json"
,
success: function (data) {
if (data.Success == true) {
ErrorMsg
2
(data.Message);
$(
'#btnApproverSelection'
).
hide
();
/* close form by calling kendo grid update */
$(
".k-grid-update"
).trigger(
'click'
);
/*qiaControl.closest(".k-window-content").data("kendoWindow").close();*/
$(
'#Grid1'
).data(
'kendoGrid'
).dataSource.read();
$(
'#Grid2'
).data(
'kendoGrid'
).dataSource.read();
mainDiv.busyIndicator(false); //
hide
}
else {
ErrorMsg(data.Message);
mainDiv.busyIndicator(false); //
hide
}
},
error: function () {
ErrorMsg(
'An error has occurred.\n'
+ data.Error +
'\n'
+ data.Message);
mainDiv.busyIndicator(false); //
hide
/*$('#btnApproverSelection').show();*/
}
});
/*mainDiv.busyIndicator(false); // hide*/
}
}
@{
Html.Kendo()
.ComboBoxFor(model => model.SendFromId)
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width:250px", data_value_primitive = "true" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action("People", "Home");
});
})
.Events(e=>
{
e.Change("onComboChanged");
})
.Deferred()
.Render();
}
I have code that looks something like this, the data provided by the additionalData function is never sent or received, only the default kendo request parameters are (sort, filter, etc).
Please fix ASAP.
<
script
>
function additionalData() {
return {
Word: "Bird",
Number: 9001
};
}
</
script
>
@(Html.Kendo().Grid<
KendoUIMvcApplication1.Models.TestModel
>()
.Name("Grid")
.DataSource(dataSource =>
{
dataSource.Ajax().Read(read => read.Action("Read", "Home").Data("additionalData"));
}))