Comments (17)
You cant use a computed attributed like that, MegaFilter needs to know the name of the field in order to work properly, you can change your code to this:
Text::make('Theme', 'theme')->displayUsing(function(){
return '.....'
})
from nova-mega-filter.
Thanks for answering so fast.
I just make what you said but now the values are just "-":
from nova-mega-filter.
is themes a relationship? maybe it should be $this->resource->themes->first()->name
? your themes is probably an empty array
from nova-mega-filter.
Yes themes is a relationship. It is not empty because all events have at least one theme and before I made the change, the values were displayed well.
Also I just make the change for $this->resource->themes->first()->name but the result is still the same
from nova-mega-filter.
If you simply do this doesnt work?
Text::make('Theme', 'theme')->displayUsing(function(){
return 'Test Hello world'
})
you see the Test Hello world
or still --
?
from nova-mega-filter.
or you could also try ->resolveUsing()
instead of ->displayUsing()
from nova-mega-filter.
If you simply do this doesnt work?
Text::make('Theme', 'theme')->displayUsing(function(){ return 'Test Hello world' })
you see the
Test Hello world
or still--
?
from nova-mega-filter.
or you could also try
->resolveUsing()
instead of->displayUsing()
Same result --> '--'
from nova-mega-filter.
Are you using the use HasMegaFilterTrait;
?
I have a similar setup and its working for me:
from nova-mega-filter.
How do you defined you column for that field in megafilter creation?
from nova-mega-filter.
I use it like this:
from nova-mega-filter.
Mmmh, I put it like you but still the same result...
Maybe I have to update the package? My current version is:
digital-creative/nova-mega-filter": "^0.2.3
from nova-mega-filter.
Maybe that's it, the latest version is v0.2.6
from nova-mega-filter.
I already update it to v0.2.6 but I have the same problem... :(
I don't know if some package could be interacting with megafilter
Also, I see that the resolveCallback is never been executed. I proved to put a dd("Hello World") inside callback but it is never shown on request
from nova-mega-filter.
I think the problem might not be with this package in your case, this is my test:
<?php
declare(strict_types = 1);
namespace App\Nova;
use App\Models\Client as ClientModel;
use DigitalCreative\MegaFilter\Column;
use DigitalCreative\MegaFilter\HasMegaFilterTrait;
use DigitalCreative\MegaFilter\MegaFilter;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
class Client extends Resource
{
use HasMegaFilterTrait;
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model = ClientModel::class;
/**
* Get the fields displayed by the resource.
*
* @param Request $request
*
* @return array
*/
public function fields(Request $request)
{
return [
Text::make('Test', 'THIS_SHOULD_MATCH')
->resolveUsing(static function () {
return 'Hello world';
}),
];
}
/**
* Get the cards available for the request.
*
* @param Request $request
*
* @return array
*/
public function cards(Request $request)
{
return [
MegaFilter::make([
'columns' => [
Column::make('Test', 'THIS_SHOULD_MATCH'),
],
]),
];
}
}
from nova-mega-filter.
Okey, thank you @milewski . Then, I'll have to keep investigating, but I don't know where to start..
from nova-mega-filter.
Confirmed, I 've updated Laravel and Nova to last versions and now is working as expected.
Thanks for your help @milewski.
from nova-mega-filter.
Related Issues (20)
- How to set custom filtersWidth for each filter? HOT 2
- Checking/Unchecking columns without effect HOT 2
- All fields is hidden if I add MegaFilter to cards HOT 5
- This package and conditional-container in the same class HOT 1
- How to colorize the mega filter column field? HOT 1
- Bug when first load resource HOT 4
- class
- Checkboxes of columns are "remembered" when I navigate back to list, but wrong columns are shown HOT 1
- How to make the columns, filters and actions sections collapsed by default ? HOT 1
- Error when moving between resources HOT 1
- Bug: column filtering not working anymore on HasMany relational table HOT 6
- What filter do use for display such badges like on ur screenshots? HOT 1
- How I can add computed column to Mega columns? HOT 1
- Save columns in session HOT 1
- Trying to access array offset on value of type null HOT 1
- Filter not working in user resource HOT 1
- Undefined array key: 'symbol' HOT 1
- Please add support for Nova 4 HOT 1
- Nova 4 Support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-mega-filter.