<script type=
"text/javascript"
>
BUI.
use
('bui/grid',
function
(Grid) {
var
data = [
<?php
foreach
(
$slice_rows
as
$key
=>
$val
){
echo
"{id:'"
.
$val
['id'].
"',imgpath:'"
.
$val
['imgpath'].
"',introduction:'"
.
$val
['introduction'].
"',linkpath:'"
.
$val
['linkpath'].
"',date:'"
.
$val
['
date
'].
"'},"
;
}
echo
"{id:'1112',imgpath:'李四',introduction:'this is a test',linkpath:'#',date:'date2'}"
;
?>
],
grid =
new
Grid.SimpleGrid({
render : '#grid',
width : 950,
columns : [
{title:'编号',dataIndex:'id',width:80},
{title:'图片路径',dataIndex:'imgpath',width:100},
{title:'简介',dataIndex:'introduction',width:200},
{title:'链接地址',dataIndex:'linkpath',width:100},
{title:'上传日期',dataIndex:'
date
',width:100}
]
});
grid.render();
grid.showData(data);
});
</script>