[Vtigercrm-developers] How to use app.notifyPostAjaxReady()?

Praneeth K praneeth at vtiger.com
Thu Nov 13 07:57:45 GMT 2014


Hi Alan,

          Yes what you have said is right , app.notifyPostAjaxReady()  will
help you in this case. To get the trigger once related list load you need
to use api *app.**listenPostAjaxReady(). *

          Currently the drawback that i am seeing in this is the same api
will be triggered on list view record load and detail view (going on detail
mode from summary mode) , So once we get trigger we need to check if we are
in detail view and the respective tab is selected then perform
the registration actions

       // Listen post ajax event

       app.listenPostAjaxReady(function(){
              // check if the view is detail view
              if(app.getViewName() == "Detail"){
                   // check if the related tab is selected and then
register events
                   if(detailInstance.getSelectedTab() == "????"){
                         thisInstance.registerEventforUpdateQty();
                   }
              }
        });


    We will be implementing creating module specific related list instance
soon,  so that we can handle register events in the instance itself .



On Wed, Nov 12, 2014 at 3:41 PM, Alan Lord (News) <alanslists at gmail.com>
wrote:

> I have a situation where I need to re-register a custom event handler on a
> relatedList in a Detail View.
>
> I'm almost there but right now I am using a bit of code like this in my
> registerEvents() function:
>
>  // Listen for ajaxComplete and re-register our eventHandler
>>         jQuery( document ).ajaxComplete(function( event, xhr, settings ) {
>>             if(xhr.responseText.indexOf('<div
>> class="relatedContainer">') == 0) {
>>                 thisInstance.registerEventforUpdateQty();
>>           }
>>       });
>>
>
> I notice there is this app.notifyPostAjaxReady() function and wonder if
> this would help me instead of the above? But it isn't very clear how to
> make use of it.
>
> Thanks
>
> Al
>
>
> --
> Libertus Solutions
> http://www.libertus.co.uk
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 

Best Regards,
K Praneeth,
vtiger Team.

*Connect with us on: *Twitter  <http://twitter.com/vtigercrm>*I* Facebook
<http://www.facebook.com/pages/vtiger/226866697333578?sk=wall> *I* Blog
<http://blog.vtiger.com/>* I* Wiki
<http://wiki.vtiger.com/index.php/Main_Page> *I *Forums
<http://forums.vtiger.com/>*I* Website <http://vtiger.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20141113/a55c1565/attachment-0001.html>


More information about the vtigercrm-developers mailing list