Solved

posting the flexigrid data

Posted on 2008-06-17
8
295 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

706 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