Solved

posting the flexigrid data

Posted on 2008-06-17
8
299 Views
Last Modified: 2010-04-21
Hello Experts,
By default I am showing 11 records in the Flexigrid, all I am trying now is to allow users to chose the records they want from the flexigrid and post to the export_list.asp page to export the data to their email.

The problem I am having now is when the user picks up some existing list from the drop down which will hide the existing Flexigrid data and show the detail of recently selected in the another Flexigrid.

Now, If I select the checkAll button on the current Flexigrit it is also picking the records of the existing Flexigrid before posting.

Is there anyway I can make the checkAll function to tick the checkboxes available on the current Flexigrid only. Please advice.

Hope you understand the problem here?

Thanks for your help



0
Comment
Question by:newbie27
  • 5
  • 2
8 Comments
 
LVL 22

Expert Comment

by:neeraj523
ID: 21802485
Well.. not sure but you can edit CheckAll function and only check those which are visible ie style property is visible or skip which are hidden
0
 
LVL 8

Author Comment

by:newbie27
ID: 21802610
Oh okay that makes sense.
I am using attached function which actually checks for each checkbox which has a class name "chkRefNos" and make it checked.

how would I do If I want to avoid those which are with in a hidden DIV - > "defaultResults"

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

please advice
thanks

function checkAll(chkd)
{
$(".chkRefNos").each(function(){
                this.checked = chkd;
            });
}
  

Open in new window

0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 21804577
If you want to "Check All" in listDisplay1 use:
function checkAll(chkd)
{
      $("#listDisplay1 > tbody > tr > td > div > input.chkRefNos").each(function(){
                this.checked = chkd;
            });
}

If you want to do so in listDisplay, then use:
function checkAll(chkd)
{
      $("#listDisplay > tbody > tr > td > div > input.chkRefNos").each(function(){
                this.checked = chkd;
            });
}
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 8

Author Comment

by:newbie27
ID: 21804732
Thanks Hielo,
Can I use something like this in the function?

if(listID=="#listDisplay"){
               var chkEvent = '<input type="checkbox" name="chkAll" onclick="checkAllDefault(this.checked)"/> All';
            }else{
               var chkEvent = '<input type="checkbox" name="chkAll" onclick="checkAllDynamic(this.checked)"/> All';
            }

this is not displaying the checkbox on the Flexigrid column...
function listViewer(listID, param1)
{      
		if(listID=="#listDisplay"){
		   var chkEvent = '<input type="checkbox" name="chkAll" onclick="checkAllDefault(this.checked)"/> All';
		}else{
		   var chkEvent = '<input type="checkbox" name="chkAll" onclick="checkAllDynamic(this.checked)"/> All';
		}
       
     	$(listID).flexigrid
		({
        		url: 'list_proxy.asp?a=results',       
        		colModel : [                    
                  //      	{display: ' ', name : 'chkDelete', width : 30, sortable : false, align: 'left'},
					//{display: chkEvent, 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 - ' + $("#drpLists").val(),
        		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" 
                			}
					);
				}
        		
        	});
 
}
 

Open in new window

0
 
LVL 82

Expert Comment

by:hielo
ID: 21804761
I don't understand your last question, but that is unrelated to what you asked here. You needed the path to select only the checked items and that's what you got for both flexigrid displays.
0
 
LVL 8

Author Closing Comment

by:newbie27
ID: 31467928
thanks
0
 
LVL 8

Author Comment

by:newbie27
ID: 21804885
0
 
LVL 8

Author Comment

by:newbie27
ID: 21804894
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Analytics setup 5 51
Add to XML (Powershell) 1 32
HTML Anchor Link Problem 3 39
MS SQL and column defined as time 7 15
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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…

820 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