Open jdvrpcre opened 3 years ago
Hey @Benjacho that's a great feature when you have a big list. I think would be nice if you take a look at this PR.
Hi @Benjacho and @dalmarcolucas, i also added a relatable dependencies feature.
If the options are dependent from other fields values (belongto, select). This method allows you fetch dependent options. You set the array of dependent fields attributes then you can use nova relatableQuery with selectedAttributeName request inputs (available when attribute value is not empty) to customize the options query.
Hope you like it.
It seems a very useful feature, @Benjacho when you can review/merge the PR?
@jdvrpcre it seems this package is abandoned and further progress is here https://github.com/OsTheNeo/NovaFields
Hi,
If the related model has lot of records, i added a 'searchable' method which allows you to fetch query dependant options (works the same as 'searchable' for the Nova belongsto field). You can limit the number of results by defining the
relatableSearchResults
property on the class of the related resource.I also added a 'debounce' method to control the debounce time for fine tuning.
Note : Lavarel Nova resource 'title' property is set to 'id' by default. I reseted the 'optionLabel' property to 'name' and only used the resource 'title' (which can easily be customized in a nova resource) to resolve options labels. In my opinion, this also avoids passing unnecessary model fields.
Hope you like it.