自定义列表页面的实现建议 [英] implementation suggesion for a customized list page

查看:85
本文介绍了自定义列表页面的实现建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这不是一个与任何代码有关的问题。我知道有非常有经验和天才

程序员在那里我所需要的只是一个建议。 br />


即时开发一个列表页面超过20列。我知道它有点长。所以我想让它更灵活,想法是..我想要用户可以选择他们需要在列表中看到哪些列。根据他们的选择数据,必须从后端返回(只有

所选列)。我们有一个非常庞大的数据库。我想做一个非常优化的请求..请建议一个最好的方法来实现这个..


this is not a question related to any code.i know there are very experienced and genius
programmers out there all i need is a suggestion.

im developing a list page which has more than 20 columns.i know its bit long.so i want to make it more flexible,the idea is..i want the user to select which columns they need to see in the list.n based on their selection data must be bring back from the back end(only
the selected columns).we have a very huge database so.i want to make very optimized request..please suggest a best way to implement this..

推荐答案

以下是一些步骤:



1.如果选择了该列,则必须将20个数据库列中的每一个都与必须设置或清除的标志相关联。要实现这一点,最好的方法是使用位字段,这样你就需要一个新列来存储位字段的值。有关管理位字段的更多详细信息,请参阅下一篇文章:蒙版和使用.NET中的位字段的标记 [ ^ ]



2.当用户选择和/或取消选择一组列==>必须使用上面第1点的逻辑更新相关的标志(从false到true或反之),然后必须将bits field列的新值存储在数据库中。



3.您使用的UI控件(网格,ListView,表格等)必须使用剃刀代码并通过检查位字段在视图中动态生成。



4.因为您使用的是庞大的数据库,所以必须实现分页以加快应用程序的加载和用户迭代。



PS:你可以在网上搜索分页文章,你也可以查看我关于MVC,jqGrid和分页的文章。
Here are some steps:

1. Each of your 20 database columns must be associated with a flag that have to be set or cleared if that column was selected or not. To implement this the best way is by using a bits field, so you will need a new column for storing the value of the bit fields. For more details about managing bits fields see the next article: Masks and flags using bit fields in .NET[^]

2. When the user will select and/or deselect a set of columns ==> the associated flags have to be updated (from false to true or viceversa) by using the logic from the 1st point above, then the new value of the "bits field" column must be stored in the database.

3. Your used UI control (Grid, ListView, table, etc) have to be generated dynamically in your view by using razor code and by checking the "bits field".

4. Because you are using a huge database, you must implement pagination to speed up the loading and the user iteration with your application.

PS: You could search for pagination articles on the web and you could have a look also on my articles about MVC, jqGrid and pagination.


这篇关于自定义列表页面的实现建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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