小编Sue*_*Sue的帖子

ASP.NET MVC 2.0在jqgrid中搜索的实现

嗨我正在尝试使用MVC 2 IN .NET(VS 2008)在jqgrid中使用单列搜索这是我到目前为止的代码,但我需要一个示例来匹配它或者我缺少的一个提示

jQuery("#list").jqGrid({
    url: '/Home/DynamicGridData/',
    datatype: 'json',
    mtype: 'POST',
    search: true,
    filters: {
        "groupOp":"AND",
        "rules": [
            {"field":"Message","op":"eq","data":"True"}
        ]
    },
    multipleSearch: false,
    colNames: [ 'column1', 'column2'],
    colModel: [
        { name: 'column1', index: 'column1', sortable: true, search: true,
          sorttype: 'text', autoFit: true,stype:'text',
          searchoptions: { sopt: ['eq', 'ne', 'cn']} },
        { name: 'column2', index: 'column2', sortable: true,search: false,
          sorttype: 'text', align: 'left', autoFit: true}],
    pager: jQuery('#pager'),
    rowNum: 10,
    rowList: [10, 60, 100],
    scroll: true,
    sortname: 'column2',
    sortorder: 'asc',
    gridview: true, …
Run Code Online (Sandbox Code Playgroud)

search linq-to-entities entity-framework jqgrid asp.net-mvc-2

25
推荐指数
1
解决办法
3万
查看次数

在控制器中创建jstree jquery_ajax

我正在使用MVC3,Jquery和jstree,我的目标是在控制器的json_data的帮助下显示jstree,我尽可能多地研究了这个但是没有解决它,我的问题是如何关联函数( n/node)到控制器中的动作,以及如何将我在控制器动作中创建的节点列表发送回视图并解析数据,我将非常感谢任何帮助或建议.

    <script type="text/javascript">



    $(function () {
        $("#demo1").jstree({
                "themes": {
                "theme": "default",
                "dots": true,
                "icons": false,
                "url": "/content/themes/default/style.css"
            },

            "json_data": {
                "ajax": {
                   "async": true,
                   "url": "/Home/GetItems",
                    "type": "POST",
                    "data": function (n) {
                        return { id: n.attr ? n.attr("id") : 0 }

                         "dataType": "text json",
                        "contentType": "application/json charset=utf-8",
                         "progressive_render": true
                    }
                }
            },
            "plugins": ["themes", "json_data", "dnd"]
        })
    });
Run Code Online (Sandbox Code Playgroud)

这是我的控制器代码与GetItems():

 [AcceptVerbs(HttpVerbs.Post)]
    public JsonResult GetItems()
          {
        int cnt = 0;
        var itemRawData = (from ItemInfo itemtInfo in _itemInfoCollection
                       where itemInfo.Name == …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc jquery jstree asp.net-mvc-3

1
推荐指数
1
解决办法
6236
查看次数