简体   繁体   English

jQuery的网格按钮不显示

[英]jquery grid buttons not showing

The buttons on my jqGrid won't show (back, forward, first page, last page, search, etc...). 我的jqGrid上的按钮将不会显示(后退,前进,第一页,最后一页,搜索等)。

Image: 图片:

Code: 码:

<h3><?php echo $title?></h3>
<?php $lastbids = SchedulesData::GetLatestBids(); print_r($lastbids);?>
<link rel="stylesheet" type="text/css" media="screen" href="website/lib/js/jqgrid/css/ui.jqgrid.css" />
<script src="website/lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="website/lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>

<table id="grid"></table>
<div id="pager"></div>
<br />

<script type="text/javascript">
$("#grid").jqGrid({
   url: 'website/schedules/schedulegrid',
   datatype: 'json',
   mtype: 'GET',
   colNames: ['Code', 'Flight Num', 'Departure', 'Arrival', 'Aircraft', 'Distance', 'Route',
                'Bid'],
   colModel : [
        {index: 'code', name : 'code', width: 40, sortable : true, align: 'center', search: 'true', searchoptions:{sopt:['eq','ne']}},
        {index: 'flightnum', name : 'flightnum', width: 65, sortable : true, align: 'center', searchoptions:{sopt:['eq','ne']}},
        {index: 'depicao', name : 'depicao', width: 60, sortable : true, align: 'center',searchoptions:{sopt:['eq','ne']}},
        {index: 'arricao', name : 'arricao', width: 60, sortable : true, align: 'center',searchoptions:{sopt:['eq','ne']}},
        {index: 'a.name', name : 'aircraft', width: 100, sortable : true, align: 'center',searchoptions:{sopt:['in']}},
        {index: 'distance', name : 'distance', width: 100, sortable : true, align: 'center', searchoptions:{sopt:['lt','le','gt','ge']}},
        {index: 'route', name : 'route', width: 100, sortable : true, align: 'center',searchoptions:{sopt:['in']}},
        {index: '', name : '', width: 100, sortable : true, align: 'center', search: false}
    ],
    pager: '#pager', rowNum: 25,
    sortname: 'flightnum', sortorder: 'asc',
    viewrecords: true, autowidth: true,
    height: '100%'

});

jQuery("#grid").jqGrid('navGrid','#pager', 
    {edit:false,add:false,del:false,search:true,refresh:true},
    {}, // edit 
    {}, // add 
    {}, //del 
    {multipleSearch:true} // search options 
); 

function showroute(schedule_id)
{
    $('#jqmdialog').jqm({
        ajax:'website/schedules/viewmap?type=schedule&id='+schedule_id
    }).jqmShow();
}

function addbid(id)
{
    $.post("http://website/schedules/addbid", { id: id },
            function() 
            { 
                $("#grid").trigger("reloadGrid"); 
            }
        );
}

function removebid(id)
{
        $.post("http://website/schedules/removebid", { id: id },
            function() 
            { 
                $("#grid").trigger("reloadGrid"); 
            }
        );

}
</script>

I looked at some other posts on stack overflow, but none of them seemed to work for me. 我查看了堆栈溢出的其他一些帖子,但是似乎没有一个适合我。 How can I get the buttons to show up? 如何显示按钮?

You have to include some jQuery UI CSS file. 您必须包括一些jQuery UI CSS文件。 For example: 例如:

<link rel="stylesheet" type="text/css"
      href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css" />

See example in the documentation . 请参阅文档中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM