The invention relates to the technical field of the BootstrapTable platform, in particular to a method for rapidly and selectively exporting data from the foreground without background data query based on the BootstrapTable platform. The method of the present invention is to add a tableExport plug-in into the front-end integrated page of BootstrapTable. When the data is exported, it is judged according to the data selected by the user. If the selected data length is greater than 0, the selected data will be exported, and then assembled into JSON data, and reloaded into the table using the load method. Otherwise, prompt the user whether to export all or the current page data, if you choose to export all, use refresh method to reload all the data, then use getData method to get the data, and finally use the tableExport method to export. The invention solves the problem that the user can export data slowly from the background and can not export data according to the selected data he needs.
【技術(shù)實(shí)現(xiàn)步驟摘要】
一種基于BootstrapTable平臺可選擇數(shù)據(jù)導(dǎo)出的方法
本專利技術(shù)涉及BootstrapTable平臺
,特別涉及一種基于BootstrapTable平臺不經(jīng)過后臺數(shù)據(jù)查詢就能從前臺快速地、可選擇性地導(dǎo)出數(shù)據(jù)的方法。
技術(shù)介紹
在BootstrapTable平臺上如果從后臺查詢數(shù)據(jù)庫然后導(dǎo)出數(shù)據(jù),容易導(dǎo)致數(shù)據(jù)加載緩慢、中間斷網(wǎng)數(shù)據(jù)不全且不能快速地選擇自己所需導(dǎo)出數(shù)據(jù)的問題;為了解決這些問題,需要在前端使用腳本來封裝一個快速導(dǎo)出頁面數(shù)據(jù)的方法來實(shí)現(xiàn)。
技術(shù)實(shí)現(xiàn)思路
本專利技術(shù)解決的技術(shù)問題在于提供一種基于BootstrapTable平臺不經(jīng)過后臺數(shù)據(jù)查詢就能從前臺快速地、可選擇性地導(dǎo)出數(shù)據(jù)的方法;解決了用戶從后臺導(dǎo)出數(shù)據(jù)緩慢、不能根據(jù)自己所需選擇數(shù)據(jù)導(dǎo)出的問題。本專利技術(shù)解決上述技術(shù)問題的技術(shù)方案是:在前端集成了BootstrapTable的頁面中加入tableExport插件,導(dǎo)出的時候根據(jù)用戶所選擇的數(shù)據(jù)進(jìn)行判斷,如果所選擇的數(shù)據(jù)長度大于0,則表示選中的數(shù)據(jù)要導(dǎo)出,然后拼裝成json數(shù)據(jù),使用load方法重新加載到table中,否則提示用戶是否導(dǎo)出全部還是當(dāng)前頁面的數(shù)據(jù),如果選擇全部導(dǎo)出,使用refresh方法重新加載全部數(shù)據(jù),接著使用getData方法獲得數(shù)據(jù),最后使用tableExport方法導(dǎo)出。從而解決了用戶從后臺導(dǎo)出數(shù)據(jù)緩慢、不能根據(jù)自己所需選擇數(shù)據(jù)導(dǎo)出的問題。所述的方法具體包括如下步驟:步驟一、創(chuàng)建一個BootstrapTable前端頁面,并添加tableExport插件,然后從服務(wù)器加載數(shù)據(jù)填充表格;步驟二、在表格上方的toolba ...
【技術(shù)保護(hù)點(diǎn)】
1.一種基于BootstrapTable平臺不經(jīng)過后臺數(shù)據(jù)查詢就能從前臺快速地、可選擇性地導(dǎo)出數(shù)據(jù)的方法,其特征在于:先在前端集成了BootstrapTable的頁面中加入tableExport插件,導(dǎo)出的時候根據(jù)用戶所選擇的數(shù)據(jù)進(jìn)行判斷,如果所選擇的數(shù)據(jù)長度大于0,則表示選中的數(shù)據(jù)要導(dǎo)出,把選擇的數(shù)據(jù)拼裝成json數(shù)據(jù),使用load方法重新加載到table中,否則提示用戶是否導(dǎo)出全部還是當(dāng)前頁面的數(shù)據(jù),如果選擇全部導(dǎo)出,使用refresh方法重新加載全部數(shù)據(jù),接著使用getData方法獲得數(shù)據(jù),最后使用tableExport方法導(dǎo)出,從而解決了用戶從后臺導(dǎo)出數(shù)據(jù)緩慢、不能根據(jù)自己所需選擇數(shù)據(jù)導(dǎo)出的問題。
【技術(shù)特征摘要】
1.一種基于BootstrapTable平臺不經(jīng)過后臺數(shù)據(jù)查詢就能從前臺快速地、可選擇性地導(dǎo)出數(shù)據(jù)的方法,其特征在于:先在前端集成了BootstrapTable的頁面中加入tableExport插件,導(dǎo)出的時候根據(jù)用戶所選擇的數(shù)據(jù)進(jìn)行判斷,如果所選擇的數(shù)據(jù)長度大于0,則表示選中的數(shù)據(jù)要導(dǎo)出,把選擇的數(shù)據(jù)拼裝成json數(shù)據(jù),使用load方法重新加載到table中,否則提示用戶是否導(dǎo)出全部還是當(dāng)前頁面的數(shù)據(jù),如果選擇全部導(dǎo)出,使用refresh方法重新加載全部數(shù)據(jù),接著使用getData方法獲得數(shù)據(jù),最后使用tableExport方法導(dǎo)出,從而解決了用戶從后臺導(dǎo)出數(shù)據(jù)緩慢、不能根據(jù)自己所需選擇數(shù)據(jù)導(dǎo)出的問題。2.根據(jù)權(quán)利要求1所述的不經(jīng)過后臺數(shù)據(jù)查詢就能從前臺快速地、可選擇性地導(dǎo)出數(shù)據(jù)的方法,...
【專利技術(shù)屬性】
技術(shù)研發(fā)人員:陳林,張來卿,龐嚴(yán)冬,
申請(專利權(quán))人:珠海橫琴盛達(dá)兆業(yè)科技投資有限公司,
類型:發(fā)明
國別省市:廣東,44
還沒有人留言評論。發(fā)表了對其他瀏覽者有用的留言會獲得科技券。