Solved

jQuery flexigrid

Posted on 2008-06-13
4
1,152 Views
Last Modified: 2010-04-21
Hello Experts,
I have 2 different results and I want to display in one <table id=""></table>, at present I am using following two tables for showing the result.
 <table id="listDisplay" style="display:none"></table>            
<table id="listDisplay1" style="display:none"></table>
I have tried using  "listDisplay" for both results but its seems that it is only working for the first ajax response ...

listViewer("#listDisplay" , sQuery);

listViewer("#listDisplay",sViewQuery);

please advice
thanks
s
                             
   
function listViewer(listID, param1)

{

     	$(listID).flexigrid

		({

        		url: 'list_proxy.asp?a=results',       

        		colModel : [                    

                        	{display: ' ', name : 'chkDelete', width : 30, sortable : false, align: 'left'},

					//{display: '<input type="checkbox" name="chkAll" onclick="checkAll(this.checked)"/> All', width : 30},

                        	{display: 'Notes', name : 'notes', width : 50, sortable : false, align: 'left'},

           			{display: 'Contact    ', name : 'pe_rev_name', width : 150, sortable : true, align: 'left'},

                    	{display: 'Compnay Name  ', name : 'co_name', width : 200, sortable : true, align: 'left'},   

                    	{display: 'Flag  ', name : 'action_flag', width : 150, sortable : true, align: 'left'},

                    	{display: 'Group  ', name : 'co_group', width : 200, sortable : true, align: 'left'}                 

        			],

        		buttons : [                             

                         {name: 'Delete', bclass: 'delete', onpress : test},

					//	{name: 'Select All', bclass: 'add', onpress : test},

					//{name: 'DeSelect All', bclass: 'delete', onpress : test}

                                

                  	],                                      

        		sortname: '',

        		sortorder: 'asc',

        		usepager: false,

        		title: 'List Manager - Titles',

        		useRp: true,

        		rp: 1000,

        		query : param1 +'&Fields=ref_no,notes,pe_rev_name,co_name,action_flag,co_group',         

        		showTableToggleBtn: true,                       

        		width: 760,

        		height: 350,

        		onSuccess:function()

	   			{

                		$(".edit_area").editable( 

						function(value, settings) { return(value); }, 

                			{     

							submit    : "OK",

							indicator : "process..........",

							tooltip   : "Click to edit...",

							style  : "inherit",

							callback  : function (value, settings){if ($(this).hasClass('trSelected')){alert('selected');}	}

                			}

					);

				}

        	});

Open in new window

0
Comment
Question by:newbie27
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 21785513
>>I have tried using  "listDisplay" for both results but its seems that it is only working for the first ajax
Most likely, what is happening is that one result is overwriting the other since both are "written" to #listDisplay, regardless of what the second parameter is. You will need to provide different ids:

 <table id="listDisplay" style="display:none"></table>            
<table id="listDisplay1" style="display:none"></table>

listViewer("#listDisplay" , sQuery);
listViewer("#listDisplay1",sViewQuery);
0
 
LVL 8

Author Closing Comment

by:newbie27
ID: 31467058
thanks
0
 
LVL 8

Author Comment

by:newbie27
ID: 21785614
just a thought hielo, can we not use one <table class="listDisplay"></table> and use it for different results set?

i mean is this necessary to define 2 separate ids here?
 <table id="listDisplay" style="display:none"></table>            
<table id="listDisplay1" style="display:none"></table>
0
 
LVL 82

Expert Comment

by:hielo
ID: 21785657
>>can we not use one <table class="listDisplay"></table>
ids MUST be unique, not classes. So if you use a class, you could potentially get a reference to multiple elements (<tables> in this case), and you will still need to figure out a way to differentiate between the tables. Using the id is the way to go.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JavaScript waiting 14 67
jQuery Parallax 1 38
How to change pointer icon to hand icon on mouseover 2 17
Wrapper for APPs 9 25
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now