<div dir="ltr">Ah yes, that's true.<div><br></div><div>For that you will have to override Vtiger_Field_Model in all the modules where you intend to use the field.</div><div><br></div><div>I Agree, ajaxEdit has nothing to do with the MetaData and better if defined in UIType class.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 22, 2020 at 7:48 PM Alan Lord <<a href="mailto:alanslists@gmail.com">alanslists@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sure - I understand that. But that means I have to edit/change core <br>
vtiger code.<br>
<br>
I already have a Vtiger_Canvas_UIType class which is effectively <br>
standalone... I was making the point that this particular method <br>
(isAjaxEditable) seems to me to belong in the UIType model not in the <br>
general Field Model because it is not possible to extend it unless you <br>
know the specific *module* and a particular Module should not really <br>
have anything to do with a Field's structure or attributes - surely?<br>
<br>
Al<br>
<br>
On 22/06/2020 15:10, nilay khatri wrote:<br>
> You can do this in the Vtiger_Field_Model class under the isAjaxEditable <br>
> fn. by adding conditions for the UIType.<br>
> <br>
> If for a specific module, extend the Vtiger_Field_Model in your module <br>
> and restrict from there.<br>
> <br>
> On Mon, Jun 22, 2020 at 6:58 PM Alan Lord <<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a> <br>
> <mailto:<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>>> wrote:<br>
> <br>
>     Following up a bit on this, I'd like to make my new custom field<br>
>     read-only in Detail View, i.e. disable Ajax Editing.<br>
> <br>
>     However the method isAjaxEditable() exists in the Vtiger_Field_Model<br>
>     (even though it mostly tests for UITypes), not in the UIType_Model<br>
>     which<br>
>     seems a bit odd to me and I can't see an easy way to extend/override<br>
>     the<br>
>     Field_Model class?<br>
> <br>
>     I can do it from the client-side fairly easily but this method just<br>
>     seems to be in the wrong class to me - by being in the Field_Model it's<br>
>     suggesting that the function is dependent on the current *Module*, not<br>
>     the current Field...?<br>
> <br>
>     Cheers<br>
> <br>
>     Al<br>
> <br>
> <br>
> <br>
>     On 22/06/2020 11:40, Alan Lord wrote:<br>
>      > I want to add a new UIType field to vtiger 7 that displays an html<br>
>      > canvas element.<br>
>      ><br>
>      > Am I right in thinking I should register it vtiger_ws_fieldtype<br>
>     and if I<br>
>      > give it a fieldtype of "canvas" then I can extend the<br>
>     Vtiger_Field_Model<br>
>      > to load it?<br>
>      ><br>
>      > One thing I don't quite get is how in Detail Views the UIType<br>
>     template<br>
>      > file does not seem to be used at all - it only seems to be called<br>
>     for<br>
>      > Edit Views. So for Detail View do I need to modify the<br>
>      > DetailViewBlockView.tpl for all/any modules where I might want to<br>
>     use my<br>
>      > new field?<br>
>      ><br>
>      > And in terms of choosing a UIType _number_ how do we prevent<br>
>     possible<br>
>      > collisions? I can choose something like 995 or whatever, but<br>
>     presumably<br>
>      > another developer could also choose the same number without knowing?<br>
> <br>
> <br>
>     _______________________________________________<br>
>     <a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
> <br>
> <br>
> _______________________________________________<br>
> <a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
> <br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>