修改 bootstrap table 默認(rèn)detailRow樣式的實(shí)例代碼
廢話不多說了,直接給大家貼代碼,具體代碼如下所示:
this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function () { var $this = $(this), //a.detail-icon $tr = $this.parent().parent(), //current row index = $tr.data('index'), row = data[index]; // Fix #980 Detail view, when searching, returns wrong row // remove and update if ($tr.next().is('tr.detail-view')) { //exsit $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailOpen)); that.trigger('collapse-row', index, row); $tr.next().remove(); $tr.next().remove(); } else { //not exsit and add $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose)); //$tr.after(sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.find('td').length)); $tr.after(sprintf('<tr class="detail-view detail-view-head"></tr>')); $tr.after(sprintf('<tr class="detail-view detail-view-body"></tr>')); var $element1 = $tr.next(); var $element2 = $element1.next(); //var $ //var $element = $tr.next().find('td'); var content = calculateObjectValue(that.options, that.options.detailFormatter, [index, row, $element1, $element2], ''); //console.log(content); //head , body Object if($element1.length === 1) { $element1.append(content.head); $element2.append(content.body); } that.trigger('expand-row', index, row, $element1, $element2); } that.resetView(); return false; });
以上所述是小編給大家介紹的修改 bootstrap table 默認(rèn)detailRow樣式的實(shí)例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
BootStrap 下拉菜單點(diǎn)擊之后不會(huì)出現(xiàn)下拉菜單(下拉菜單不彈出)的解決方案
最近學(xué)到Bootstrap下拉菜單,學(xué)懂了教程內(nèi)容之后自己敲一個(gè)點(diǎn)擊按鈕底下彈出下拉菜單的小demo,寫完代碼發(fā)現(xiàn)運(yùn)行之后點(diǎn)擊按鈕沒反應(yīng),下拉菜單彈不出來,下面給大家分享下解決方案2016-12-12微信小程序?qū)崿F(xiàn)漸入漸出動(dòng)畫效果
這篇文章主要給大家介紹了關(guān)于微信小程序?qū)崿F(xiàn)漸入漸出動(dòng)畫效果的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用微信小程序具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-06-06JS正則RegExp.test()使用注意事項(xiàng)(不具有重復(fù)性)
這篇文章主要介紹了JS正則RegExp.test()使用注意事項(xiàng),結(jié)合實(shí)例形式分析了RegExp.test()方法的功能與用法,以及針對(duì)不能重復(fù)調(diào)用的解決方法,需要的朋友可以參考下2016-12-12回車直接實(shí)現(xiàn)點(diǎn)擊某按鈕的效果即觸發(fā)單擊事件
這篇文章主要介紹了回車直接實(shí)現(xiàn)點(diǎn)擊某按鈕的效果即觸發(fā)單擊事件,需要的朋友可以參考下2014-02-02javascript入門之?dāng)?shù)組[新手必看]
本文介紹了javascript 數(shù)組的定義和數(shù)組元素的操作,ECMAScript中的數(shù)組方法...希望對(duì)大家有所幫助2016-11-11