Phone Myat
Panel Nav Bar item focus when click
When I select the nav bar item, the scroll bar go back to the top. I want to remain the nav bar at the same position when I click the nav item outside of the window screen. How can I do that? Thanks for reading.
3 replies
Interact with Event in custom livewire component with filament table
class AvailableRooms extends Component implements HasTable, HasForms
{
use InteractsWithTable;
use InteractsWithForms;
public $availableRoomID = [];
#[On('availableRoom')]
public function index($available_room_id){
$this->availableRoomID = $available_room_id;
}
function table(Table $table): Table
{
return $table
->query(Room::whereIn('id', $this->availableRoomID))
->columns([
TextColumn::make('room_name'),
TextColumn::make('room_type'),
]);
}
public function render()
{
return view('livewire.available-rooms');
}
}
When I receive event from available room, i want to store it to $availableRoomID variable and use it to query table. However it run table function run first and then run funtion for event. So variable is wrong for table query. How can I make it work for dynamic query? Or Can I run event function first? Thanks for Reading.2 replies