这是我的Kendo UI网格.一切正常,但问题是当我更改网格单元格 inline 时,它不会触发datasource.transport.update调用.为什么不呢?
This is my kendo UI grid. It's reading fine, but the problem is that it wont fire the datasource.transport.update call when I change a grid cell inline. Why won't it?
我已经确保指定了一个id列,并且传输CRUD函数都属于同一类型(此处为函数,而不是url),但是我尝试将其也与url一起使用.只有transport.read会触发...
I've made sure I specified an id column and that the transport CRUD functions are all of the same type (functions here, not urls), but I've tried to have it work with urls as well. Only transport.read will fire...
当我检查控制台日志时,没有给出错误.
when I check the console logs there are no errors given.
因此,我想对其进行内联编辑.单击网格上的一个单元格,然后更改值,当您离开该单元格的焦点时,我想运行dataSource.transport.update()或任何函数.
So I want to edit it inline. Click on a cell on the grid, and change the value, when u leave focus of the cell I want dataSource.transport.update() to run, or any function at all.
jsfiddle/8tzgc/135/
在对文档进行了一些研究之后,我发现了关于change()事件的信息.通过检查它是哪种更改事件,我们可以弄清它是否是一个更新事件,并运行我们自己想要的功能.这是我更新的jsfiddle:
After doing some research on the docs I've found out about the change() event. By checking what kind of change event it is we can figure out if its an update event and run the function we want ourselves. Here's my updated jsfiddle:
jsfiddle/8tzgc/140/
如果有人想出了一种无需您自己调用更新函数的方法,那么我无所不用其极.
If anyone figures out a way that does not require calling the update function yourself, then I'm all ears.
推荐答案要进行内联编辑,您可以直接使用 telerik演示站点.
To edit inline, you can just leverage the example from the telerik demo site.
将命令列更改为:
{ command: ["edit", "destroy"], title: " ", width: "160px" }并将editable规范更改为"inline":
editable: "inline",我已经使用以下解决方案编辑了您的小提琴: jsfiddle/8tzgc/136/
I have edited your fiddle with the solution: jsfiddle/8tzgc/136/
为了充分充实它,您必须提供命令中相关方法的实现,例如update,create等.您可以在 telerik演示.
In order to fully flesh this out, you would have to provide implementation for the associated methods from the command, such as update, create, etc... You can see those examples in the telerik demo.
如果您想使用自定义编辑器(下拉菜单等)进行单元格单击编辑,则此处为另一个telerik示例.
If you would like to do cell-click editing with custom editors (dropdowns, etc), here is another telerik example.
还有批量编辑示例.
更多推荐
kendo UI网格更新功能不会触发
发布评论