Link to home
Start Free TrialLog in
Avatar of Coast Line
Coast LineFlag for Canada

asked on

jquery UI

I have a Tab system like below:

$( "#tabs" ).tabs({
             beforeLoad: function( event, ui ) {
             ui.jqXHR.error(function() {
             ui.panel.html(
                   "Couldn't load this tab. We'll try to fix this as soon as possible.");
                   });
             }
       });

Now inside the first Tab, i have a link names view Data. Open Clicking  want that it should open in the Same Tab from were it is clicked and show the data in tabular format. and in that page [Add Data] link will be there, which will just open the add action within the same Tab

how this is possible.

Also while viewing i want to use pagination so it loads data within the same and navigate back and forth

Please guide
Avatar of mcnute
mcnute
Flag of Germany image

Add Data link is calling some page which outputs information in a database?

I would do it like the following:

$.ajax({
        url: '/path/to/the/page/which-querys-your-data.php',
        data: 'some data in a key-value manner',
        error: function (XMLHttpRequest, textStatus, errorThrown) {
             console.log(textStatus+' '+errorThrown);
        },
        success: function(data) {
            $('.class_of_element_where_the_data_goes').html(data);
        }
        });

Open in new window


Your php page is making a query of your database and would echo the html already in the table structure.
ASKER CERTIFIED SOLUTION
Avatar of Coast Line
Coast Line
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Coast Line

ASKER

Solved Own by Using jquery UI tabs ID attribute and calling the Page using the Load Functionality