<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — How to include checkbox in Table Pager]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6065&amp;type=atom" />
	<updated>2016-02-16T03:29:32Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6065</id>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25201#p25201" />
			<content type="html"><![CDATA[<p>As the db_pager_view.inc is a core file, modifying it may not be good. Checking the file that @joe suggested may be useful.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-02-16T03:29:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25201#p25201</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25193#p25193" />
			<content type="html"><![CDATA[<p>currently, it works fine when clicking and staying in any table page</p><p>but when changing the page still there is a problem to be resolved.</p><p>//-------------------------------------------------------------------------------------------------------------------------<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the bellow sequence is very important for controlling the checkboxes relation header / rows<br />//-------------------------------------------------------------------------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <br />$id = find_submit(&#039;_rec_&#039;);&nbsp; &nbsp; &nbsp; // check if a row was clicked</p><p>if (!check_value(&#039;chkbx&#039;)) { update_all(&#039;0&#039;) ;&nbsp; }&nbsp; &nbsp;// always clear all the rows checkboxes whenever the header is not marked</p><p>if ( check_value(&#039;chkbx&#039;)==1 &amp;&amp; $id == -1) { update_all(&#039;1&#039;) ;&nbsp; }&nbsp; // when we are sure that the header is<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; clicked and not one of the rows was clicked<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />if ($id != -1)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // when a row is clicked =&gt; toggle its mark &amp; update the &quot;sel_chk&quot; field to (0 || 1 )<br />&nbsp; &nbsp; &nbsp; &nbsp; { <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $chkbox_value = check_value(&quot;rec_&quot;.$id) ? &#039;1&#039; : &#039;0&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update_gl_trans_sel_chk_value($id,$chkbox_value);<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>//--------------------------------------------------------------------------------------------------------------------------<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the above sequence is very important for controlling the checkboxes relation header / rows<br />//--------------------------------------------------------------------------------------------------------------------------</p><br /><p>I m sure now that things are on the right track.</p><p>- the goods is I didn&#039;t use javascripts until now except of the standard ((( JsHttpRequest.request(&quot;_XXXX_update&quot;, this.form); )))</p><p>- the bads is that I was obliged to control the header checkbox through modifications in db_pager_view.inc file: </p><p>related to&nbsp; &nbsp;:&nbsp; &nbsp; $labels[0]&nbsp; &nbsp;&lt;==&gt;&nbsp; $table-&gt;columns-&gt;headers[0]&nbsp; &nbsp;( table header )</p><br /><p>thanks for your support</p><p>Khaled</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-02-14T21:46:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25193#p25193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25187#p25187" />
			<content type="html"><![CDATA[<p>Avoid sessions and keep the js local at the client side. Just toggle the state of the &quot;select all&quot; checkbox and on it&#039;s change based on it&#039;s current value, either populate or clear all target checkboxes and make sure the value of the &quot;select all&quot; checkbox is a blank string when submitting the form and it is to be ignored in the form processor.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-02-14T05:56:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25187#p25187</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25185#p25185" />
			<content type="html"><![CDATA[<p>Hi,</p><p>to resolve the checkboxes select/deselect in the rows, I did the following :</p><p>- I added a temporary field column &quot;sel_chk&quot; to the $sql used in journal_inquiry ( based on adding join the existing &quot;gl_trans&quot; to temporary table containing [ clone of gl_trans.counter &amp; sel_chk] </p><p>- I controlled their previous selection&nbsp; within the $sql pagination by adding a $_session var for the journal_inquiry page &amp; by adding a conditional check in db_pager_view.inc </p><p>- I imitate the selection checkboxes as in : /gl/bank_account_reconcile.php and it works ok for the rows.</p><br /><p>Now for doing the check ALL case in the deader i m freezed:</p><p>- I cannot adopt the JAVASCRIPT approach as in the links because it deals with the seen page only, and when paginating it flashes away all the checkboxes ( I tried as described )</p><p>- I tried to call a php function through AJAX ( it looks a good approach ) but i failed because it seems that in this JAVA / AJAX / PHP connection, JAVSCRIPT establish a new connection tunnel for the communication and in this case it couldn&#039;t recognize all of the server original environment and and the relations were lost.</p><p>it is really a difficult exercise.</p><p>khaled</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-02-13T18:57:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25185#p25185</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25173#p25173" />
			<content type="html"><![CDATA[<p>When done, please submit patches here for peer review and possible inclusion in FA 2.4.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-02-10T13:03:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25173#p25173</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25171#p25171" />
			<content type="html"><![CDATA[<p>Thanks for your reply.</p><p>Khaled</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-02-10T11:11:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25171#p25171</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25167#p25167" />
			<content type="html"><![CDATA[<p>The current implementation of the&quot;X&quot; in the checkbox column header is not designed to work as expected by you - in fact it does not have js attached to it.</p><p>Reference implementations are available at:<br /><a href="http://stackoverflow.com/questions/19282219/check-uncheck-all-the-checkboxes-in-a-table">http://stackoverflow.com/questions/1928 … in-a-table</a><br />and<br /><a href="http://stackoverflow.com/questions/386281/how-to-implement-select-all-check-box-in-html">http://stackoverflow.com/questions/3862 … ox-in-html</a></p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-02-10T05:41:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25167#p25167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25162#p25162" />
			<content type="html"><![CDATA[<p>Hi Joe,</p><p>Controlling the checkboxes in the tables rows are ok now ( learned how to do it from : bank_account_reconcile.php ), </p><p>but still I failed to control the top checkbox in their column header.</p><p>The idea is to use it as : check all / uncheck all / checked (whenever one of the rows checkboxes is checked)</p><p>AND whenever the header is being checked a tiny icon menu will&nbsp; show up ( and this tiny menu will disappear when unchecked ).</p><p>Any suggestion ?</p><p>Regards,<br />Kalido</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-02-09T18:20:57Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25162#p25162</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25074#p25074" />
			<content type="html"><![CDATA[<p>Hi, </p><p>I couldn&#039;t understand your comment, but I attached the pic to help figure out what i am working on.</p><p>Anyhow I appreciate any help in this regard.</p><p>I did a deep search for a solution on the net, but it seems it is a bit complicated to have such kind of control and I found nothing interesting unless advises to use $_session ( cookies ) when paginating to hold control of checked checkboxes.</p><p>I didn&#039;t found any sample to base my trials on it and because of that I tried to ask for suggestions.</p><p>For sure there is no selfishness when I said that I failed to do this exercise.&nbsp; &nbsp; <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Thanks,<br />Kalido</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-01-22T22:52:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25074#p25074</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25035#p25035" />
			<content type="html"><![CDATA[<p>Attached your screenshot here for self-sufficiency.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-01-17T02:14:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25035#p25035</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25019#p25019" />
			<content type="html"><![CDATA[<p>I will submit the code, but until now I failed to hold the checkbox&#039;s when activating AJAX.</p><p>I added the checkbox&#039;s to a new Journal Inquiry page and trying to control the selection for exporting or printing out.</p><p>Any proposal ?</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2016-01-11T16:23:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25019#p25019</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24957#p24957" />
			<content type="html"><![CDATA[<p>Wouldn&#039;t you want to submit your code?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-12-24T18:02:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24957#p24957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24956#p24956" />
			<content type="html"><![CDATA[<p>hey,</p><p>really i m thankful a lot.</p><p>Kalido</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2015-12-22T17:48:37Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24956#p24956</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24955#p24955" />
			<content type="html"><![CDATA[<p>Thanks,</p><p>I m trying to have a new look for ..\gl\inquiry\journal_inquiry.php with which&nbsp; I want to add a new checkbox column at the beginning <br />of the displayed table.</p><p>When selecting checkbox&#039;s , it will popup a set of control buttons who will allow us to Export the selected rows.</p><p>It is a some kind of additional control to add for List inquiry web pages used in different locations of FA.</p><p>Kalido</p>]]></content>
			<author>
				<name><![CDATA[Kalido]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=434</uri>
			</author>
			<updated>2015-12-22T17:41:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24955#p24955</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to include checkbox in Table Pager]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24954#p24954" />
			<content type="html"><![CDATA[<p>Hello, <br />Yes it is possible. Please have a look into Search not invoiced deliveries in Sales tab.<br />Here you will se a column with checkboxes for batching the deliveries.<br />Maybe you can get an idea from here.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2015-12-22T17:38:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24954#p24954</id>
		</entry>
</feed>
