Skip to content

Commit

Permalink
Table demo
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyleung committed Jul 19, 2017
1 parent 3361cc3 commit bf0412f
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.6.1 (July 19, 2017)
* Update Table demo.

## 1.6.0 (July 18, 2017)
* New component: `Switch`.

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="#" class="active">BizUI</a>
<a href="pages/tutorial.html">起步</a>
<a href="pages/components.html">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.0</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.1</a>
<a href="https://github.com/bizdevfe/biz-ui-react" target="_blank">React</a>
<a href="https://github.com/bizdevfe/biz-ui-mobile" target="_blank">Mobile</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "biz-ui",
"version": "1.6.0",
"version": "1.6.1",
"description": "A jQuery plugin for business UI components",
"author": "BizFE",
"main": "dist/jquery.bizui.js",
Expand Down
2 changes: 1 addition & 1 deletion pages/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="../index.html">BizUI</a>
<a href="tutorial.html">起步</a>
<a href="#" class="active">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.0</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.1</a>
<a href="https://github.com/bizdevfe/biz-ui-react" target="_blank">React</a>
<a href="https://github.com/bizdevfe/biz-ui-mobile" target="_blank">Mobile</a>
</nav>
Expand Down
30 changes: 29 additions & 1 deletion pages/src/components/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ var Table = Backbone.View.extend({
title: 'Operation',
escapeContent: false,
content: function(item, index, field) {
return '<a href="javascript:void(0)" id="' + item.id + '">Detail</a>';
return '<select id="' + item.id + '">\
<option value="edit">Edit</option>\
<option value="delete">Delete</option>\
<option value="open">Open</option>\
</select>';
}
}
];
Expand Down Expand Up @@ -152,6 +156,30 @@ var Table = Backbone.View.extend({
console.log('Fail', data);
}
});

$('select').bizSelect()
.on('selectric-before-open', function() { // 解决表格遮挡问题
$('.biz-table td').css({'overflow': 'visible'});
$('.biz-table-body-wrap').css({'overflow': 'visible'});
$('.biz-table-head-wrap').css({'overflow': 'visible'});
})
.on('selectric-close', function() {
$('.biz-table td').css({'overflow': 'hidden'});
$('.biz-table-body-wrap').css({
'overflowX': 'auto',
'overflowY': 'hidden'
});
$('.biz-table-head-wrap').css({
'overflowX': 'auto',
'overflowY': 'hidden'
});
});

bizui.Tooltip({
element: '.protocol',
preventDefault: true,
action: 'click'
});
},

destroy: function() {
Expand Down
24 changes: 23 additions & 1 deletion pages/src/components/Table/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ <h4>JavaScript</h4>
title: 'Operation',
escapeContent: false,
content: function(item, index, field) {
return '&lt;a href="javascript:void(0)" id="' + item.id + '"&gt;Detail&lt;/a&gt;';
return '&lt;select id="' + item.id + '"&gt;\
&lt;option value="edit"&gt;Edit&lt;/option&gt;\
&lt;option value="delete"&gt;Delete&lt;/option&gt;\
&lt;option value="open"&gt;Open&lt;/option&gt;\
&lt;/select&gt;';
}
}
];
Expand Down Expand Up @@ -151,6 +155,24 @@ <h4>JavaScript</h4>
}
});

$('select').bizSelect()
.on('selectric-before-open', function() { // 解决表格遮挡问题
$('.biz-table td').css({'overflow': 'visible'});
$('.biz-table-body-wrap').css({'overflow': 'visible'});
$('.biz-table-head-wrap').css({'overflow': 'visible'});
})
.on('selectric-close', function() {
$('.biz-table td').css({'overflow': 'hidden'});
$('.biz-table-body-wrap').css({
'overflowX': 'auto',
'overflowY': 'hidden'
});
$('.biz-table-head-wrap').css({
'overflowX': 'auto',
'overflowY': 'hidden'
});
});

</code></pre>

<h4>Options</h4>
Expand Down
2 changes: 1 addition & 1 deletion pages/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="../index.html">BizUI</a>
<a href="#" class="active">起步</a>
<a href="components.html">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.0</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.1</a>
<a href="https://github.com/bizdevfe/biz-ui-react" target="_blank">React</a>
<a href="https://github.com/bizdevfe/biz-ui-mobile" target="_blank">Mobile</a>
</nav>
Expand Down

0 comments on commit bf0412f

Please sign in to comment.