Grid.MVC生成一个data-url:为什么以及如何阻止此选项 [英] Grid.MVC generates a data-url: why and how to prevent this option

查看:135
本文介绍了Grid.MVC生成一个data-url:为什么以及如何阻止此选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于每个可排序列标题,将呈现url控制器/操作链接。单击列标题以对GRID进行排序 - 而是执行控制器/操作。如何规避这个?

==================================== ==========================================

按要求澄清:

------------------------

使用Grid.MVC使用可排序的标题/标题显示数据。期望是当单击列标题/标题时,将对数据进行排序,而不是执行控制器操作。原因是HTML包含每个标题/标题列的URL链接。



另一种询问方式是 - 排序功能如何工作 - 我会期望Grid.MVC独立处理排序并重新渲染视图。发生了什么是Grid MVC正在执行一个控制器动作



======================= ================================================== ========

Re:建议在操作方法中处理排序和刷新页面

-------------- -------------------------------------------------- -------

如果Grid MVC没有处理排序并使用新的排序顺序刷新Grid - 为什么要使用Grid MVC?

For each sortable column header a url controller/action link is rendered. When the column header is clicked to sort the GRID - what happens instead is the controller/action is executed. How can this be circumvented?
==============================================================================
As requested to clarify:
------------------------
Grid.MVC is used to present data with sortable Titles/headers. The expectation is when a column title/header is clicked the data will be sorted instead the controller action is executed. The reason is the header the HTML contains a url link for each title/header column.

Another way of asking would be - How does the sort feature work - I would expect Grid.MVC to handle the sorting independently and re-render the view. What is happening is Grid MVC is executing a controller action

=================================================================================
Re: Suggestion to handle sorting and refreshing page in action method
-----------------------------------------------------------------------
If Grid MVC does not handle the sorting and refreshing the Grid with the new sort order - why use Grid MVC?

推荐答案

我想你不想刷新页面。

但是在这里你犯了一个错误,无论何时点击任何动作链接,它都会调用动作方法。



仍然你可以使用AJAX实现这一目标。还有一个AJAX网格。如果您不想使用它,那么您必须使用AJAX和部分视图自己编写。



查看此库,

AJAX网格 [ ^ ]



-KR
I guess you don't want to refresh the page.
But here you're making a mistake, whenever any action link clicked, it'll call the action method.

Still you can achieve this using AJAX. There's a AJAX grid too. If you don't want to use it then you have to write it all on your own using AJAX and Partial Views.

Check out this library,
AJAX Grid[^]

-KR


这篇关于Grid.MVC生成一个data-url:为什么以及如何阻止此选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆