首页 新闻 会员 周边 捐助

mvc4中用上一种grid

0
悬赏园豆:20 [待解决问题]

比如flexigrid等,整个一个 实现操作

xinshen的主页 xinshen | 初学一级 | 园豆:167
提问于:2013-04-07 10:42
< >
分享
所有回答(2)
0

jqgrid

chenping2008 | 园豆:9836 (大侠五级) | 2013-04-07 10:49

那请问 前后台是怎么一个情况

支持(0) 反对(0) xinshen | 园豆:167 (初学一级) | 2013-04-07 10:52

@xinshen: jqgrid有现成的例子的。可以参考

http://www.trirand.com/blog/jqgrid/jqgrid.html

支持(0) 反对(0) chenping2008 | 园豆:9836 (大侠五级) | 2013-04-07 11:10

jquery.jqGrid.min.js这个文件好像没有下载过来

支持(0) 反对(0) xinshen | 园豆:167 (初学一级) | 2013-04-07 11:18

@xinshen: http://www.trirand.com/blog/jqgrid/js/jquery.jqGrid.js 在IE下,直接可以下载

支持(0) 反对(0) chenping2008 | 园豆:9836 (大侠五级) | 2013-04-07 15:56

那在MVC上条件查询在前后台怎么交互

支持(0) 反对(0) xinshen | 园豆:167 (初学一级) | 2013-04-08 14:41
0

view 视图@modelIEnumerable<OrderDto>
@using(Html.Configurator("The grid should...")
             
.PostTo("FirstLook","Grid")
             
.Begin())
   
{
   
<ul>
       
<li>@Html.CheckBox("ajax",true,"make <strong>AJAX</strong> requests")</li>
       
<li>@Html.CheckBox("grouping",true,"allow <strong>grouping</strong> of data")</li>
       
<li>@Html.CheckBox("filtering",true,"allow <strong>filtering</strong> of data")</li>
       
<li>@Html.CheckBox("paging",true,"have <strong>pages</strong> with 10 items")</li>
       
<li>@Html.CheckBox("scrolling",true,"show a <strong>scrollbar</strong> when there are many items")</li>
       
<li>@Html.CheckBox("sorting",true,"allow <strong>sorting</strong> of data")</li>
       
<li>@Html.CheckBox("showFooter",true,"show footer")</li>
   
</ul>
    <button class="t-button t-state-default" type="submit">Apply</
button>
 
}
@(Html.Telerik().Grid(Model)
       
.Name("Grid")
       
.Columns(columns =>
       
{
            columns
.Bound(o => o.OrderID).Width(100);
            columns
.Bound(o => o.ContactName).Width(200);
            columns
.Bound(o => o.ShipAddress);
            columns
.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
       
})
       
.DataBinding(dataBinding =>
       
{
            dataBinding
.Server().Select("FirstLook","Grid",new{ ajax =ViewData["ajax"]});
            dataBinding
.Ajax().Select("_FirstLook","Grid").Enabled((bool)ViewData["ajax"]);
       
})
       
.Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"]))
       
.Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"]))
       
.Pageable(paging => paging.Enabled((bool)ViewData["paging"]))
       
.Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
       
.Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
       
.Footer((bool)ViewData["showFooter"])
)

Controller

namespaceTelerik.Web.Mvc.Examples
{
   
usingSystem;
   
usingSystem.Web.Mvc;
   
usingTelerik.Web.Mvc.Examples.Models;
   
publicpartialclassGridController:Controller
   
{
       
publicActionResultFirstLook(bool? ajax,bool? scrolling,bool? paging,bool? filtering,bool? sorting,
           
bool? grouping,bool? showFooter)
       
{
           
ViewData["ajax"]= ajax ??true;
           
ViewData["scrolling"]= scrolling ??true;
           
ViewData["paging"]= paging ??true;
           
ViewData["filtering"]= filtering ??true;
           
ViewData["grouping"]= grouping ??true;
           
ViewData["sorting"]= sorting ??true;
           
ViewData["showFooter"]= showFooter ??true;
           
returnView(GetOrderDto());
       
}
       
[GridAction]
       
publicActionResult _FirstLook()
       
{
           
returnView(newGridModel(GetOrderDto()));
       
}
   
}
}

不老的童话 | 园豆:57 (初学一级) | 2013-04-07 14:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册