首页 新闻 会员 周边

easyui基础问题

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

MVC4程序,新建conctroller,把jquery-easyui-1.3.1/demo/accordion的代码复制到view里,修改了js引用,运行以后界面是有了,但是点击add的时候出错了:SCRIPT438: 对象不支持“accordion”属性或方法。请教大神

@{
    ViewBag.Title = "Index";
}

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Accordion - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.3.1/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.3.1/themes/icon.css">
    
    <script type="text/javascript" src="../../jquery-easyui-1.3.1/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="../../jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        function select(){
            $('#aa').accordion('select','Title1');
        }
        var idx = 1;
        function add(){
            $('#aa').accordion('add',{
                title:'New Title'+idx,
                content:'New Content'+idx
            });
            idx++;
        }
        function remove(){
            var pp = $('#aa').accordion('getSelected');
            if (pp){
                var index = $('#aa').accordion('getPanelIndex',pp);
                $('#aa').accordion('remove',index);
            }
        }
    </script>
</head>
<body>
    <h2>Accordion</h2>
    <div class="demo-info">
        <div class="demo-tip icon-tip"></div>
        <div>Click on panel header to show its content.</div>
    </div>
    
    <div style="margin: 10px 0;">
        <a href="#" class="easyui-linkbutton" onclick="select()">Select</a>
        <a href="#" class="easyui-linkbutton" onclick="add()">Add</a>
        <a href="#" class="easyui-linkbutton" onclick="remove()">Remove</a>
    </div>
    
    <div id="aa" class="easyui-accordion" style="width:700px;height:300px;">
        <div title="Title1" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
            <h3 style="color:#0099FF;">Accordion for jQuery</h3>
            <p>Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.</p>
        </div>
        <div title="Title2" data-options="iconCls:'icon-search',selected:true,
                tools:[{
                    iconCls:'icon-reload',
                    handler:function(){
                        $('#tt').datagrid('reload');
                    }
                }]">
            <table id="tt" class="easyui-datagrid" 
                    data-options="url:'../../jquery-easyui-1.3.1/demo/datagrid_data2.json',border:false,fit:true,fitColumns:true,singleSelect:true">
                <thead>
                    <tr>
                        <th data-options="field:'itemid',width:80">Item ID</th>
                        <th data-options="field:'productid',width:100">Product ID</th>
                        <th data-options="field:'listprice',width:80,align:'right'">List Price</th>
                        <th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
                        <th data-options="field:'attr1',width:150">Attribute</th>
                        <th data-options="field:'status',width:50,align:'center'">Status</th>
                    </tr>
                </thead>
            </table>
        </div>
        <div title="Title3" style="padding:10px;">
            content3
        </div>
    </div>
</body>
</html>
View Code

 

squalle的主页 squalle | 初学一级 | 园豆:192
提问于:2013-11-14 14:04
< >
分享
所有回答(1)
0

js路径是对

jewely | 园豆:109 (初学一级) | 2013-11-14 22:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册