22 lines
978 B
Text
22 lines
978 B
Text
@using Kreta.Web.Helpers
|
|
@using Kreta.Web.Areas.Tanulo.Models
|
|
|
|
@{
|
|
var domId = ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty);
|
|
var query = @ViewData["query"] ?? string.Empty;
|
|
}
|
|
|
|
@model object
|
|
@Html.KretaComboBoxFor(Model => Model, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = ViewData["ddlController"], action = ViewData["ddlAction"] })+ query, "Text", "Value").AutoBind(true).Events(e=>e.DataBound(@"
|
|
function (e) {
|
|
KretaComboBoxHelper.onDataBound(e);
|
|
var uid = $('#" + @ViewData["gridId"] + @"').find('.k-grid-edit-row').attr('data-uid');
|
|
var data = KretaGridHelper.getGridRowData('" + @ViewData["gridId"] + @"', uid);
|
|
var baseValue = parseFloat( data." + @ViewData["ddlProperty"] + @");
|
|
if(!isNaN(baseValue) && baseValue > 0){
|
|
var cb = $('#" + @domId + @"').data('kendoComboBox');
|
|
cb.value(baseValue);
|
|
cb.trigger('change');
|
|
}
|
|
}
|
|
"))
|