Adding condition for reordering

so i have a table which have position column which i am reordering ...and the position 1 data will show in a separate widget than the list table...but when i am trying reordering the list table first what happen my data position was becoming 1 then when i applied condition for not ordering position 1 it worked for previous issue but its not reordering
7 Replies
Patrick Boivin
Patrick Boivin16mo ago
The widget is independent from the table, it won't refresh on its own when the table is filtered or sorted
ba_mbi_07
ba_mbi_07OP16mo ago
i am talking about when i am trying reordering list table as position 1 data is not present list that was becoming position which i dont want
ba_mbi_07
ba_mbi_07OP16mo ago
ba_mbi_07
ba_mbi_07OP16mo ago
Is there any way to fix that
Patrick Boivin
Patrick Boivin16mo ago
Sorry, I don't understand what's happening. Can you share some code?
ba_mbi_07
ba_mbi_07OP16mo ago
its my featured widget Query
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->where('position', 1);
}
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->where('position', 1);
}
its my list page
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->whereNot('position', 1);
}

public function getReorderColumn(): ?string
{
return 'position';
}
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->whereNot('position', 1);
}

public function getReorderColumn(): ?string
{
return 'position';
}
Patrick Boivin
Patrick Boivin16mo ago
I see... I'm not sure I can help with this unfortunately. I don't think the reordering feature was designed to work that way.
Want results from more Discord servers?
Add your server