开发者

Load dynamically created jQuery UI tab using script

Could anyone advise, or provide some pointers on how to achive the following goal with jQuery UI Tabs.

I currently have a jQuery UI tabs interface that displays a single google viz table which is populated with data from a database. When I select one of the rows, I call a select event to create a new tab, which is named using a cell from the selected row. Everything appears to be working as expected so far, but I would like to expand upon the creation of new tabs by dynamically loading some data into the new tab, which could include additional charts, using google visualization api.

I am really struggling on getting some basic calls implented that wou开发者_JAVA百科ld allow me to call a simple script from which I can build upon at a later date.

If anyone has tried this before and found this to not work, or can offer any guidance it would be most appreciated.

Cheers.


I see that there has been some viewers of this posting, so I wanted to share my findings for those that might need some assistance with this in the future...

$tabs = $("#tabs").tabs({
                    tabTemplate: "<li><a href='#{href}'>#{label}</a><span class='ui-icon ui-icon-close'>Remove Tab</span></li>",
                    add: function( event, ui ) {
                        $(ui.panel).load("src/getDetails.php", {'q': + 'release_1234'}, function(response, status, xhr){
                            if(status == "error"){
                                var msg = "Sorry, but there appears to be an error: ";
                                $("#error").html(msg + xhr.status + " " + xhr.statusText);
                            }
                        });
                    }
                });

Now all I need to figure out is how to pass a variable to replace the hardcoded value for release_1234 - shout if you have any ideas.

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜