[Vtigercrm-developers] vt7 Overriding Javascript Classes
Alan Lord
alanslists at gmail.com
Wed Jun 28 13:48:11 GMT 2017
Further investigations mean I'm now fairly sure I only need to override
the searchModuleNames function in Vtiger.js ;-)
This function is called both in Detail and Edit Views. In Detail I can
live with it because the record has already been saved.
But in Edit View it could be a new record. I need to read the values of
a couple of fields in the DOM and pass these in the Ajax call to
BasicAjax in _my_ module's action class.
I really can't see how I can use the jQuery class features to override
Vtiger_Index_Js so I am wondering if there is something I could do based
on the "post.editView.load" client-side event handler? Could I "remove"
or "disable" the Event registered (in Vtiger_Index_Js) on the reference
field and then add my own?
Al
On 27/06/17 15:11, Alan Lord wrote:
> I need to override the searchModuleNames functions so that I can pass
> some extra data during type-ahead search in reference fields.
>
> This function is included in two files:
>
> layouts/v7/modules/Vtiger/resources/Vtiger.js
> and
> layouts/v7/modules/Vtiger/resources/Detail.js
>
> (The one in Detail.js I don't think actually ever gets used.)
>
> So how do override the one in Vtiger.js?
>
> Do I create a
>
> /layouts/v7/modules/MyModuleName/resources/MyModuleName.js file and
> inherit from Vtiger_Index_Js?
>
> The Detail.js override wont work because it the searchModuleNames
> function is already loaded via the registerAutoCompleteFields in Vtiger.js
>
> Cluebat anyone?
>
> TIA
>
> Al
>
> _______________________________________________
> http://www.vtiger.com/
>
More information about the vtigercrm-developers
mailing list