You need to sign in to do that
Don't have an account?
asadim
dataTable id not recognized by jQuery
Hi,
If I have a dataTable with id = tableId and use jQuery to access it using $("#tableId") it doesn't work. But when I create the same table using regular HTML tags it works.
Anybody know's what's going on?
Thanks.
Is your table embedded within other Visualforce elements? If so, you need to chain together the ids for those elements. For example, if you had the following:
PageBlock1
DataTable1 (Enclosed in PageBlock1)
You'd reference DataTable1 as follows:
(Use the single-quoted text.) Let me know if that works.
-- Matt
$("#pageid:formid:pageblockid:pbsectionid:tableid")
The semi colons visualforce generates makes jQuery not work. It is discussed here:
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F
but even the solution provided doesn't always work. What I have done is give elements styleClasses and they use this in the the jQuery selectors. Peformance may not be as great but you don't have to deal with the potential of ids changing.
Just for reference: