浏览代码

Merge pull request #3004 from wenzhixin/feature/2991

fix #2991: Add event parameters faq
文翼 8 年之前
父节点
当前提交
266cd0417a
共有 3 个文件被更改,包括 66 次插入2 次删除
  1. 22 0
      docs/_i18n/en/faq/faq.md
  2. 23 1
      docs/_i18n/es/faq/faq.md
  3. 21 1
      docs/_i18n/zh-cn/faq/faq.md

+ 22 - 0
docs/_i18n/en/faq/faq.md

@@ -30,6 +30,28 @@ $table.on('load-success.bs.table column-switch.bs.table page-change.bs.table sea
 
 
 ---
 ---
 
 
+### Is event parameter put in the wrong order?
+
+When you use like this:
+
+```
+$('#eventsTable').on('click-row.bs.table', function (event, row, $element) {
+
+});
+```
+
+the first parameter is always `event`: http://jsfiddle.net/wenyi/e3nk137y/11688/
+
+and use onClickRow event:
+
+```
+onClickRow: function (row, $element) {
+
+}
+```
+
+---
+
 ### How can I support development of bootstrap-table?
 ### How can I support development of bootstrap-table?
 
 
 All your ideas and feedback are very appreciated! Please feel free to open issues on GitHub or send me email.
 All your ideas and feedback are very appreciated! Please feel free to open issues on GitHub or send me email.

+ 23 - 1
docs/_i18n/es/faq/faq.md

@@ -30,8 +30,30 @@ $table.on('load-success.bs.table column-switch.bs.table page-change.bs.table sea
 
 
 ---
 ---
 
 
+### Is event parameter put in the wrong order?
+
+When you use like this:
+
+```
+$('#eventsTable').on('click-row.bs.table', function (event, row, $element) {
+
+});
+```
+
+the first parameter is always `event`: http://jsfiddle.net/wenyi/e3nk137y/11688/
+
+and use onClickRow event:
+
+```
+onClickRow: function (row, $element) {
+
+}
+```
+
+---
+
 ### How can I support development of bootstrap-table?
 ### How can I support development of bootstrap-table?
 
 
 All your ideas and feedback are very appreciated! Please feel free to open issues on GitHub or send me email.
 All your ideas and feedback are very appreciated! Please feel free to open issues on GitHub or send me email.
 
 
-I'm also grateful for your donations: <a href="donate">{% t pages.donate.title %}</a>
+I'm also grateful for your donations: <a href="donate">{% t pages.donate.title %}</a>

+ 21 - 1
docs/_i18n/zh-cn/faq/faq.md

@@ -30,8 +30,28 @@ $table.on('load-success.bs.table column-switch.bs.table page-change.bs.table sea
 
 
 ---
 ---
 
 
+### 事件参数位置错误?
+
+当你使用:
+
+```
+$('#eventsTable').on('click-row.bs.table', function (event, row, $element) {
+
+});
+```
+
+的时候,第一个参数总是 `event`:http://jsfiddle.net/wenyi/e3nk137y/11688/
+
+而使用 `onClickRow` 就正常:
+
+```
+onClickRow: function (row, $element) {
+
+}
+```
+
 ### 我要如何支持 Bootstrap Table 的开发?
 ### 我要如何支持 Bootstrap Table 的开发?
 
 
 非常感谢你的想法和建议,你可以到 GitHub 上提 issue 或者发邮件给我。
 非常感谢你的想法和建议,你可以到 GitHub 上提 issue 或者发邮件给我。
 
 
-当然,假如你也可以 <a href="donate">{% t pages.donate.title %}</a> 我们的项目。
+当然,假如你也可以 <a href="donate">{% t pages.donate.title %}</a> 我们的项目。