Ceck, if a tab already exists.
In a callback, I open tabs like this:
- $('#packageTable tbody').on( 'click', 'button', function () {
- var data = table.row($(this).parents('tr')).data();
- var tabId = "tab-" + data.id;
- $("<li id=" + tabId + "><a href='" + tabId + "'>" + data.package + "</a</li>")
- .appendTo("#tabs .ui-tabs-nav");
- $("#tabs").tabs("refresh");
- });
In other words: The tabs have an associated id. (The tabId.) Now, I'd like to change the callback as follows:
Check, if a tab with the given id is already open. If so, do nothing. Otherwise, create the new tab.
How would I do that?
Thanks,
Jochen