protected sealed override void WriteScript(IHtmlWriter writer, FieldInfo field) { writer.Append(" var o = {}; "); if (field.ListItems != null) { writer.Append("o.dataValueField=\"value\";"); writer.Append("o.dataTextField=\"text\";"); writer.Append("o.valuePrimitive=true;"); if (!String.IsNullOrEmpty(field.ListItems.Url)) { writer.Append("o.autoBind=false;"); writer.Append("o.dataSource=DS.initAjax({ read: function(o) { return { url:\"" + field.ListItems.Url + "\", type:\"" + field.ListItems.Type + "\" } } });"); } else if (!String.IsNullOrEmpty(field.ListItems.Expression)) { writer.Append("o.dataSource=new kendo.data.DataSource({data:Util.parseExpression(\"" + field.ListItems.Expression + "\") });"); } this.SetExtendedOptions(writer); } writer .Append("var ctrl=") .Append("$(\"#") .Append(this.PropertyName) .Append("\"); ctrl.") .Append(this.DoKendoName()) .Append("(o);"); //if (field.Width > 0) //{ // writer // .Append("var cbx= ctrl.data(WidgetName.kendoComboBox);") // .Append("cbx.list.width(") // .Append(field.Width) // .Append(");"); //} }
protected override void WriteScript(IHtmlWriter writer, FieldInfo field) { writer .Append("var o = {};"); if (!String.IsNullOrEmpty(field.Field.DataFormatString)) { writer .Append("o.mask=\"") .Append(field.Field.DataFormatString) .Append("\"; "); } writer .Append("$(\"#") .Append(this.PropertyName) .Append("\").kendoMaskedTextBox(o);"); }
protected override void WriteScript(IHtmlWriter writer, FieldInfo field) { writer .Append("$(\"#") .Append(this.PropertyName) .Append("\").kendoDateTimePicker("); if (!String.IsNullOrEmpty(field.Field.DataFormatString)) { writer .Append("{format:\"") .Append(field.Field.DataFormatString) .Append("\"}"); } writer.Append(");"); }
protected override void SetExtendedOptions(IHtmlWriter writer) { writer.Append("o.filter=\"startswith\";"); }