我的Bootstrap下拉列表在某些页面上不起作用?

时间:2015-10-06 04:59:16

标签: html css twitter-bootstrap codeigniter

我正在使用codeigniter开发一个应用程序,我正在使用Bootstrap来设置它的样式。 在我的应用程序中,我有几页。我有一个page_header文件,我已经定义了所有的css和js文件。现在,当我在我的仪表板上时,导航栏的下拉列表可以正常工作,但当我在同一个应用程序的任何其他页面上时,同样不起作用。

这是我的Header文件代码:

            <META HTTP-EQUIV="Pragma" CONTENT="private">
        <META HTTP-EQUIV="Cache-Control" CONTENT="private, max-age=5400, pre-check=5400">
        <META HTTP-EQUIV="Expires" CONTENT="<?php echo date(DATE_RFC822,strtotime("1 day")); ?>">

        <!DOCTYPE html>
        <html>
        <head>
            <meta charset="UTF-8">
            <title><?php echo $meta_title; ?></title>
            <!-- Bootstrap -->
            <link href="<?php echo site_url('css/bootstrap.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/add.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/datepicker.css'); ?>" rel="stylesheet">





            <link href="<?php echo site_url('css/jquery-ui.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/jquery-ui.min.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/jquery-ui.structure.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/jquery-ui.structure.min.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/jquery-ui.theme.css'); ?>" rel="stylesheet">
            <link href="<?php echo site_url('css/jquery-ui.theme.min.css'); ?>" rel="stylesheet">



            <link href="<?php echo site_url('/bower_components/metisMenu/dist/metisMenu.min.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('/dist/css/timeline.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('/dist/css/sb-admin-2.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('/bower_components/morrisjs/morris.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('bower_components/font-awesome/css/font-awesome.min.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('bower_components/metisMenu/dist/metisMenu.min.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('bower_components/datatables-responsive/css/dataTables.responsive.css'); ?>" rel="stylesheet">

            <link href="<?php echo site_url('/bower_components/bootstrap/dist/css/bootstrap.min.css'); ?>" rel="stylesheet">






            <link rel="shortcut icon" href="<?php echo site_url('img/favicon.ico'); ?>" type="image/x-icon" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script‌​>




                <script src="http://code.jquery.com/jquery-latest.js"></script>
                <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>



                        <script>
                        $(function()
                        {
                            $('#spinnerInput').spinner();
                        });
                        </script>







        <script src="<?php echo site_url('js/bootstrap.min.js'); ?>"></script>

        <script src="<?php echo site_url('bower_components/metisMenu/dist/metisMenu.min.js'); ?>"></script>
        <script src="<?php echo site_url('/bower_components/datatables/media/js/jquery.dataTables.min.js'); ?>"></script>
        <script src="<?php echo site_url('/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js'); ?>"></script>
        <script src="<?php echo site_url('/dist/js/sb-admin-2.js'); ?>"></script>






            <script src="<?php echo site_url('bower_components/bootstrap/dist/js/bootstrap.min.js');?>"></script>

            <script src="<?php echo site_url('bower_components/metisMenu/dist/metisMenu.min.js');?>"></script>


            <script src="<?php echo site_url('bower_components/raphael/raphael-min.js');?>"></script>

            <script src="<?php echo site_url('js/morris-data.js');?>"></script>

            <script src="<?php echo site_url('dist/js/sb-admin-2.js');?>"></script> 




              <script>
                $(document).ready(function() {
                    $('#dataTables-example').DataTable({
                            responsive: true
                    });
                });
                </script>





        <script>


        function showEdit(editableObj) {
            $(editableObj).css("background","#FFF");
        } 


            function save(editableObj,column,id) {

            $(editableObj).css("background","#FFF url(<?php echo site_url('img/loaderIcon.gif');?>) no-repeat right");
            $.ajax({

                url: "<?php echo base_url()?>admin/user/updateDb",
                type: "POST",
                data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id,
                success: function(data){
                    $(editableObj).css("background","#FDFDFD");
                }  

            });
        }


        </script>

            <script type="text/javascript">
        function edit_Reseller(editableObj) {
            $(editableObj).css("background","#FFF");
        } 


            function save_reseller(editableObj,column,id) {

            $(editableObj).css("background","#FFF url(<?php echo site_url('img/loaderIcon.gif');?>) no-repeat right");
            $.ajax({

                url: "<?php echo base_url()?>admin/reseller/update_reseller",
                type: "POST",
                data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id,
                success: function(data){
                    $(editableObj).css("background","#FDFDFD");
                }  

            });
        }




    </script>















        </script>
            <?php if(isset($sortable) && $sortable === TRUE): ?>
            <script src="<?php echo site_url('js/jquery-ui-1.9.1.custom.min.js'); ?>"></script>
            <script src="<?php echo site_url('js/jquery.mjs.nestedSortable.js'); ?>"></script>
            <?php endif; ?>

            <meta http-equiv="X-UA-Compatible" content="IE=edge" />
            <!-- TinyMCE -->
            <script type="text/javascript" src="<?php echo site_url('js/tiny_mce/tiny_mce.js'); ?>"></script>
            <script type="text/javascript">
                tinyMCE.init({
                    // General options
                    mode : "textareas",
                    theme : "advanced",
                    plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",

                    // Theme options
                    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
                    theme_advanced_toolbar_location : "top",
                    theme_advanced_toolbar_align : "left",
                    theme_advanced_statusbar_location : "bottom",
                    theme_advanced_resizing : true,
                });
            </script>
            <!-- /TinyMCE -->

            <script type="text/javascript">
            $(document).ready(function () {
                $("#grid").shieldGrid({
                    dataSource: {
                        data: gridData,
                        schema: {
                            fields: {
                                id: { path: "id", type: Number },
                                age: { path: "age", type: Number },
                                name: { path: "name", type: String },
                                company: { path: "company", type: String },
                                month: { path: "month", type: Date },
                                isActive: { path: "isActive", type: Boolean },
                                email: { path: "email", type: String },
                                transport: { path: "transport", type: String }
                            }
                        }
                    },
                    sorting: {
                        multiple: true
                    },
                    rowHover: false,
                    columns: [
                        { field: "name", title: "Person Name", width: "120px" },
                        { field: "age", title: "Age", width: "80px" },
                        { field: "company", title: "Company Name" },
                        { field: "month", title: "Date of Birth", format: "{0:MM/dd/yyyy}", width: "120px" },
                        { field: "isActive", title: "Active" },
                        { field: "email", title: "Email Address", width: "250px" },
                        { field: "transport", title: "Custom Editor", width: "120px", editor: myCustomEditor },
                        {
                            width: "104px",
                            title: "Delete Column",
                            buttons: [
                                { cls: "deleteButton", commandName: "delete", caption: "<img src='http://www.prepbootstrap.com/Content/images/template/BootstrapEditableGrid/delete.png' /><span>Delete</span>" }
                            ]
                        }
                    ],
                    editing: {
                        enabled: true,
                        event: "click",
                        type: "cell",
                        confirmation: {
                            "delete": {
                                enabled: true,
                                template: function (item) {
                                    return "Delete row with ID = " + item.id
                                }
                            }
                        }
                    },
                    events:
                    {
                        getCustomEditorValue: function (e) {
                            e.value = $("#dropdown").swidget().value();
                            $("#dropdown").swidget().destroy();
                        }
                    }
                });

                function myCustomEditor(cell, item) {
                    $('<div id="dropdown"/>')
                        .appendTo(cell)
                        .shieldDropDown({
                            dataSource: {
                                data: ["motorbike", "car", "truck"]
                            },
                            value: !item["transport"] ? null : item["transport"].toString()
                        }).swidget().focus();
                }
            });
        </script>

        <style type="text/css">
            .sui-button-cell
            {
                text-align: center;
            }

            .sui-checkbox
            {
                font-size: 17px !important;
                padding-bottom: 4px !important;
            }

            .deleteButton img
            {
                margin-right: 3px;
                vertical-align: bottom;
            }

            .bigicon
            {
                color: #5CB85C;
                font-size: 20px;
            }
        </style>

0 个答案:

没有答案