Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jquery UI

Posted on 2012-12-23
3
Medium Priority
?
302 Views
Last Modified: 2012-12-28
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
0
Comment
  • 2
3 Comments
 
LVL 11

Expert Comment

by:mcnute
ID: 38717387
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.
0
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 0 total points
ID: 38718011
Thanks for the Info, I solved it by using the ID of the Tab and then Reloading the Contents through the Herf Attribute and Jquery's ON click event

Thanks
0
 
LVL 16

Author Closing Comment

by:Gurpreet Singh Randhawa
ID: 38726464
Solved Own by Using jquery UI tabs ID attribute and calling the Page using the Load Functionality
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question