問(wèn)題描述
是否可以僅對(duì)一個(gè)數(shù)據(jù)表應(yīng)用某個(gè)過(guò)濾器?我在準(zhǔn)備好文檔時(shí)應(yīng)用了以下過(guò)濾器功能,我不知道這是否是正確的程序,但作為副作用,所有數(shù)據(jù)表都會(huì)受到過(guò)濾器的影響.我只想影響 $('#productTable'),但這個(gè)選擇器似乎沒(méi)有預(yù)期的效果.
Is it possible to apply a certain filter to only one datatable? I have the following filter function that I am applying on document ready, I don't know if this is proper procedure, but as a side effect all dataTables will be affected by the filter. I would Like to affect only the $('#productTable'), but this selector appears to not have the desired effect.
是否可以僅對(duì)特定表應(yīng)用過(guò)濾器?我該如何做到這一點(diǎn)?
Is it possible to apply a filter only to a particular table? How do I accomplish this?
數(shù)據(jù)表初始化:
推薦答案
您可以創(chuàng)建一個(gè)表數(shù)組來(lái)進(jìn)行過(guò)濾 - 然后在您的過(guò)濾器中檢查當(dāng)前表是否存在于該數(shù)組中......類似于:
You could create an array of tables to have the filter - then in your filter check if the current table is present in that array ... something like :
這篇關(guān)于如何將過(guò)濾器應(yīng)用于特定的數(shù)據(jù)表的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!