草庐IT

kendo-template

全部标签

javascript - 从 Kendo Treeview 中读取选定节点的值?

我有一个KendoTreeview,它有一个带有{id,value}的节点。我想在单击按钮时获取选定节点的ID和值。我怎样才能得到它?是否有任何内置函数可以获取它?这是我的示例代码:$("mytree").kendoTreeView({dataSource:mydata,dataTextField:"Name",dataValueField:"Id",}); 最佳答案 使用.select()方法。请务必查看其他可用的方法。vartv=$('.mytree').data('kendoTreeView'),selected=tv.sel

javascript - AsyncFileUpload Inside Listview Insert、Edit Itemtemplate 和 EmptyData Template 将不起作用

AsyncFileUpload在ListviewInsert、EditItemtemplate和EmptyDataTemplate中不起作用。以上是我的客户端函数functionAttachmentUploadSuccessful(){debugger;vartextError=$(".AttachmentError").text();if(textError.length>0){vartext=$(".AttachmentError");text.innerText=text.textContent=textError;sender._onError(textError);//itw

javascript - 如何使用 JSON 作为 contentType 制作 Kendo MVC Helpers 的 CRUD

@(Html.Kendo().DropDownListFor(model=>model.ServiceID).OptionLabelTemplate("#=optionLabel#").ValueTemplate("#=Code#(#=Rate#)-#=Description#").Template("#=Code#(#=Rate#)-#=Description#").DataTextField("Code").DataValueField("ServiceID").DataSource(d=>{d.Read(read=>{read.Action("GetServiceReposito

javascript - 从Javascript中的Kendo网格中的列名获取列索引

如果我们知道Kendo网格中的列名,是否有一种方法可以找到网格中列的索引?例如EmployeeID|Name123|John我想知道“名称”字段的索引,即网格中的1。任何建议。谢谢。桑吉夫 最佳答案 请尝试使用以下代码片段。JayeshGoyaniGetIndex$(document).ready(function(){$("#example").kendoGrid({dataSource:{type:"odata",transport:{read:"https://demos.telerik.com/kendo-ui/servic

javascript - 如何使用 Kendo 文件上传发送额外值

我正在尝试上传文件,并且文件上传正在成功上传。当我发送额外的值以及文件上传保存url时,我遇到了问题。我已经创建了一个jsfiddleJsfiddleExampleLink我可以上传文件,但我想在上传文件的同时发送下拉菜单值和文本框值。DocumentTypeIdProofDrivingLiscenceOtherDocNumberAcceptablefiletypes:.xmlFilesizelimit:5MB$("#dropdownlist").kendoDropDownList();$("#batchFile").kendoUpload({async:{saveUrl:'/Uplo

javascript - 如何从 Kendo 网格中的 ClientTemplate 调用 javascript 方法?

可否在Kendogrid的ClientTemplate中放入javascript语句?我想在客户端计算一些数据,然后将结果放在行中。我试过这个:columns.Bound("ExecutionStartDateTime").Title("SummaryLine").Width("20%").ClientTemplate("scheduleForm.generateSummary(#=ExecutionStartDateTime#,2);");然而,它并没有产生任何效果。 最佳答案 您可以使用模板文字语法:functionsomeFu

javascript - Meteor template.find 未定义

我正在尝试使用template.find让我的生活更轻松。但在javascript控制台中我得到:undefinedisnotafunction这是我的。它在template.find(...)上被绊倒了Template.superuserHUD.events={'clickinput.new_device':function(template){varid=template.find(".new_device_id").value;Device_IPs.insert({ID:id,IP:"NotConnected"});}}有什么想法吗? 最佳答案

javascript - Kendo UI 下拉列表采用最大选项的大小

varddlViews=$('#ddlViews').data("kendoDropDownList");ddlViews.list.width("auto");我已将宽度添加为自动但它不起作用,下拉框的宽度也获得了所选元素的最大宽度并溢出了框。我希望下拉框具有固定宽度,但下拉列表项应在单行中显示内容。因为正常的下拉菜单会起作用。 最佳答案 .k-list-container{min-width:126px!important;//giveaminwidthofyourchoicewidth:auto!important;}.k-l

javascript - 在 Kendo Ui Grid 弹出窗口中更改按钮文本

我有一个KendoUIGrid,它会在创建新记录或编辑现有记录时加载弹出窗口。当我创建新记录时,我努力寻找一种方法将“更新”按钮的文本更改为“保存”(它当前显示“更新”-但它不正确)。我能够更改弹出窗口的标题,但我的问题是:如何更改按钮文本?这是代码:$("#grid").kendoGrid({dataSource:dataSource,pageable:true,sortable:true,groupable:true,height:resizeGrid(),filterable:true,toolbar:["create"],columns:[{field:"OfficeName"

javascript - 无法加载模板 : uib/template/modal/window. html

我觉得我已经尝试了所有方法,但仍然出现错误:Failedtoloadtemplate:uib/template/modal/window.html在我的索引文件中,我添加了以下内容:我在我的应用文件中添加了:'ui.bootstrap',我在我的Controller文件中添加了以下内容:$uibModal和this.openPayment=function(){varmodalInstance=$uibModal.open({ariaLabelledBy:'modal-title',ariaDescribedBy:'modal-body',templateUrl:'payment.ht