<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Ajax in FA - Analysis (WIP)]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5340&amp;type=atom" />
	<updated>2020-08-24T19:41:39Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5340</id>
		<entry>
			<title type="html"><![CDATA[Re: Ajax in FA - Analysis (WIP)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38142#p38142" />
			<content type="html"><![CDATA[<p>Hi,</p><p>how the function list_updated($name) will know which code or function should be triggered to return the response?</p><br /><p>Thanks</p>]]></content>
			<author>
				<name><![CDATA[trainer2008]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45577</uri>
			</author>
			<updated>2020-08-24T19:41:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38142#p38142</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ajax in FA - Analysis (WIP)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33788#p33788" />
			<content type="html"><![CDATA[<p>Have you seen the ajax search box means of choosing an item, supplier or customer by using the appropriate checkboxes in the company setup form? Similar paged lists are also available for items, suppliers and customers in some other forms on pressing the search icon (magnifying glass) beside those fields.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-12-30T04:23:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33788#p33788</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ajax in FA - Analysis (WIP)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=33774#p33774" />
			<content type="html"><![CDATA[<p>Hi apmuthu,<br />I have seen the WIKI page for Ajax in FA, but it only contains information about updating fields, is there any way I can list data using ajax in FA ?<br />e.g. Suppose I&#039;m having around more than 1 lac records in my stock_master then it will take forever to load Item page. So here I&#039;m thinking of implementing ajax listing (like autocomplete), Please suggest me if there is any better option for this issue..</p>]]></content>
			<author>
				<name><![CDATA[phpninja123]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44226</uri>
			</author>
			<updated>2018-12-28T14:45:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=33774#p33774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Ajax in FA - Analysis (WIP)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21572#p21572" />
			<content type="html"><![CDATA[<p>The wiki page for <a href="https://frontaccounting.com/fawiki/index.php?n=Devel.AjaxInFA">Ajax in FA</a> is ready for updation.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-11-27T05:34:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21572#p21572</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Ajax in FA - Analysis (WIP)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21571#p21571" />
			<content type="html"><![CDATA[<p>There appears to be a lack of documentation (even in the wiki) regarding Ajax as used in FrontAccounting. Before making a wiki page for it, those in the know can contribute to this thread from where it will be distilled into the wiki.</p><p>If on the change of value of any FA form element, some ajax work needs to be done (like other form elements getting updated or some function being executed), then a $_POST array element needs to be set and sent. </p><p>The $_POST array element must bear a name that embeds the ajax requesting element&#039;s <strong>name</strong> attribute as seen in Lines 300 to 307 in the <strong>function list_updated($name)</strong> in <strong>includes/ui/ui_lists.inc</strong> file:<br /></p><div class="codebox"><pre><code>/*
    Helper function.
    Returns true if selector $name is subject to update.
*/
function list_updated($name)
{
    return isset($_POST[&#039;_&#039;.$name.&#039;_update&#039;]) || isset($_POST[&#039;_&#039;.$name.&#039;_button&#039;]);
}</code></pre></div><p>Hence if the ajax requesting form element is <strong>stock_id</strong> then the hidden form elemet that is sent over for an ajax call in FA would either be:<br />$_POST[&#039;_stock_id_update&#039;]<br />or<br />$_POST[&#039;_stock_id_button&#039;]<br />for the <strong>function list_updated($name)</strong> to trigger the ajax response.</p><p>To get the response inside a target form element, it&#039;s name attribute is passed on like <strong>$Ajax-&gt;activate(&#039;price&#039;)</strong>.</p><p>This is seen for example in lines 506-511 in <strong>sales/includes/ui/sales_order_ui.inc</strong>:<br /></p><div class="codebox"><pre><code>        if (list_updated(&#039;stock_id&#039;)) {
                $Ajax-&gt;activate(&#039;price&#039;);
                $Ajax-&gt;activate(&#039;units&#039;);
                $Ajax-&gt;activate(&#039;qty&#039;);
                $Ajax-&gt;activate(&#039;line_total&#039;);
        }</code></pre></div><p>All functions that assist ajax responses are in <strong>includes\ui\ui_lists.inc</strong>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-11-27T05:01:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21571#p21571</id>
		</entry>
</feed>
