⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Question about the docs for setModel



NadimD
  • profile picture
  • Member

Posted 13 January 2019 - 23:29 PM

Hello John :)

 

I was reading the docs (Entreprise Edition) about callbackColumn here : https://www.grocerycrud.com/enterprise/api-and-function-list/callbackColumn

 

And I'm facing the problem you talk about. Making a custom column affects the search function and it won't work properly.

What did you mean when you said to use a setModel ? I don't see how you would use a Model in this case !

 

Could you tell me more ? Thanks ! :)

 

Update : I did a patch in order to make the search function work with a relation and its custom fields.

I will release it if you agree, but since it is Entreprise Edition, please let me know what to do with the patch.

 

That's how it works now, first I can search as always in a non related field, and I can make a callback on the column "page_id" with the name "Page associée" displayed here :

 

YdAAMEc.png

 

 

And I can type in multiple words, multiple "like" queries will be added to the whereStatements function and explode each keyword typed to give this result :

 

DxP6rRU.png

 

Also, spaces will be ignored so that you can make a copy&paste without worrying about formatting the text.


larasmith
  • profile picture
  • Member

Posted 16 January 2019 - 05:44 AM

Hi @NadimD,

 

Your work here is quite interesting.

I haven't tried using callbackColumn in any of my projects so I can't share anything regarding this yet.

 

:)


NadimD
  • profile picture
  • Member

Posted 18 January 2019 - 23:51 PM

Thank you @larasmith .

 

I've finished my patch and will soon release a post to add :

- Search with multiple words on 1_to_N relations

- Multiple field names when using set_relation and a custom display

 

I just need to optimize a little bit the code before releasing it, you'll be notified in this post aswell.

 

Stay tuned !


spiritbreaker69
  • profile picture
  • Member

Posted 23 January 2019 - 03:54 AM

im facing this issue with setmodel.. filter is not working on relation.. its giving a blank or not working..


NadimD
  • profile picture
  • Member

Posted 23 January 2019 - 12:20 PM

What version are you using ? I will provide you my fixes according asap


spiritbreaker69
  • profile picture
  • Member

Posted 24 January 2019 - 03:12 AM

im currently using 2.7 but same as other version


NadimD
  • profile picture
  • Member

Posted 27 January 2019 - 01:58 AM

All right, I'm currently far from home and I don't have my computer with me, I will be back next week and will notify you here when the patch is released, sorry for the delay but I cannot do better than that atm!