bootstrap table實(shí)現(xiàn)點(diǎn)擊翻頁功能 可記錄上下頁選中的行
更新時(shí)間:2017年09月28日 10:11:15 作者:_linka
這篇文章主要介紹了bootstrap table實(shí)現(xiàn)點(diǎn)擊翻頁功能,可記錄上下頁選中的行,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
bootstrap-table中實(shí)現(xiàn),翻頁之后再返回,依然選中的情況,具體內(nèi)容如下
//var productids = $("body",window.parent.frames[0].document).find('.ptids');//textarea存放數(shù)據(jù) var productids = $('textarea'); var merge_order_object= {};//頁碼+id組成的對(duì)象 var jsonObj = {}; var current_page = "";//當(dāng)前頁碼 //表格渲染完成操作 table.on('post-body.bs.table', function (e, settings, json, xhr) { var merge_order_arr = []; var objString = productids.val(); if(objString !== ""){ jsonObj = JSON.parse(objString);//轉(zhuǎn)換為json對(duì)象 $.map(jsonObj, function (arr) { // merge_order_arr.push.apply(merge_order_arr,arr);//合并數(shù)組 merge_order_arr = merge_order_arr.concat(arr);//合并數(shù)組 }); $.each(settings,function (i,v) { $.each(merge_order_arr,function (index,value) { if(v.id === parseInt(value)){ $(e.target).find('tbody tr').eq(i).find('input').click(); } }); }); // productids.val( objString ); } // debugger; }); $('input[name="btSelectAll"], table tbody, input[name="btSelectItem"]').change(function () {//復(fù)選框 current_page = table.bootstrapTable('getOptions').pageNumber; merge_order_object[current_page] = Table.api.selectedids(table); productids.val( JSON.stringify(merge_order_object) );//轉(zhuǎn)換成字符串 });
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
uni-app中如何使用uni.showModal添加輸入框
uni-app是一種使用Vue.js開發(fā)所有前端應(yīng)用的框架,uni.showModal是其API之一,用于展示模態(tài)彈窗并可添加輸入框,通過editable屬性設(shè)置彈窗內(nèi)容是否可編輯,通過success回調(diào)函數(shù)處理用戶點(diǎn)擊結(jié)果,這提供了一個(gè)交互式元素,方便在應(yīng)用中收集用戶輸入的信息2024-09-09elementui?日歷組件el-calendar使用總結(jié)
這篇文章主要介紹了elementui?日歷組件el-calendar使用總結(jié),引用dayjs處理日期,結(jié)合el-calendar完美實(shí)現(xiàn),需要的朋友可以參考下2024-07-07cypress e2e測(cè)試編寫注意點(diǎn)總結(jié)分析
這篇文章主要為大家介紹了cypress e2e測(cè)試編寫注意點(diǎn)總結(jié)分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04uni-app小程序沉浸式導(dǎo)航實(shí)現(xiàn)的全過程
在跨端項(xiàng)目開發(fā)中,uniapp是個(gè)不錯(cuò)的框架,下面這篇文章主要給大家介紹了關(guān)于uni-app小程序沉浸式導(dǎo)航實(shí)現(xiàn)的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-10-10