这是我的剑道 UI 网格.它读起来很好,但问题是当我更改网格单元内联时,它不会触发 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":
And change your editable specification to "inline":
editable: "inline",我已经用解决方案编辑了您的小提琴:jsfiddle/8tzgc/136/
I have edited your fiddle with the solution: jsfiddle/8tzgc/136/
为了充分体现这一点,您必须从命令中提供相关方法的实现,例如更新、创建等...您可以在 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.
还有这个批量编辑的例子.
更多推荐
剑道 UI 网格更新功能不会触发
发布评论