CyladeJS
CyladeJS
Explore posts from servers
FFilament
Created by CyladeJS on 5/18/2024 in #❓┊help
Autofill on TextInput
Code
TextInput::make('purchase')
->label('Purchase')
->numeric()
->required()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
]),

TextInput::make('selling')
->label('Selling')
->numeric()
->required()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
]),

TextInput::make('profit')
->label('Profit')
->disabled()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
])
TextInput::make('purchase')
->label('Purchase')
->numeric()
->required()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
]),

TextInput::make('selling')
->label('Selling')
->numeric()
->required()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
]),

TextInput::make('profit')
->label('Profit')
->disabled()
->columnSpan([
'sm' => 12,
'xl' => 4,
'2xl' => 4,
])
Hello, I'm just learning Filament. I need help regarding TextInput autofilling. From the code above, how do I ensure that when I fill in purchase and selling, profit will be automatically filled in?
7 replies
DIAdiscord.js - Imagine an app
Created by CyladeJS on 2/8/2024 in #djs-questions
Suggestion System with Polling
Hello, I want to ask for help to improve my code, I want to create a feature like in the video bellow, so when the embed is first sent it will have 2 buttons, namely upvoteButton.setLabel('⬆️'); and downvoteButton.setLabel('⬇️');. Users can only select one button
if the user selects the "⬆️" { button
then update the button `upvote.setLabel(`⬆️ ${number of votes}`) downvote.setLabel(`⬇️`)` then followUp with the message(`\`\` Upvote added!`). Check if the user selects this "⬆️" button again? If yes then follow up with the message (`\`\` Upvote removed!`).

Check again if there is only 1 user providing interaction. For example, he selects the button "⬆️" then the button will look like this "⬆️ 1" "⬇️". If the user selects the upvote button again then follow up with the message (`\`\` Upvote removed!`) and the button returns to `upvoteButton.setLabel('⬆️');` and `downvoteButton.setLabel('⬇️') ;`
}

if the user selects the "⬇️" { button
then update the button `upvote.setLabel(`⬆️`) downvote.setLabel(`⬇️ ${number of votes}`)` then followUp with the message(`\`\` Downvote added!`). Check if the user selects this "⬇️" button again? If yes then follow up with the message (`\`\` Downvote removed!`).

Check again if there is only 1 user providing interaction. For example, he selects the button "⬆️" then the button will look like this "⬆️ 1" "⬇️". If the user selects the upvote button again then follow up with the message (`\`\` Upvote removed!`) and the button returns to `upvoteButton.setLabel('⬆️');` and `downvoteButton.setLabel('⬇️') ;`
}
if the user selects the "⬆️" { button
then update the button `upvote.setLabel(`⬆️ ${number of votes}`) downvote.setLabel(`⬇️`)` then followUp with the message(`\`\` Upvote added!`). Check if the user selects this "⬆️" button again? If yes then follow up with the message (`\`\` Upvote removed!`).

Check again if there is only 1 user providing interaction. For example, he selects the button "⬆️" then the button will look like this "⬆️ 1" "⬇️". If the user selects the upvote button again then follow up with the message (`\`\` Upvote removed!`) and the button returns to `upvoteButton.setLabel('⬆️');` and `downvoteButton.setLabel('⬇️') ;`
}

if the user selects the "⬇️" { button
then update the button `upvote.setLabel(`⬆️`) downvote.setLabel(`⬇️ ${number of votes}`)` then followUp with the message(`\`\` Downvote added!`). Check if the user selects this "⬇️" button again? If yes then follow up with the message (`\`\` Downvote removed!`).

Check again if there is only 1 user providing interaction. For example, he selects the button "⬆️" then the button will look like this "⬆️ 1" "⬇️". If the user selects the upvote button again then follow up with the message (`\`\` Upvote removed!`) and the button returns to `upvoteButton.setLabel('⬆️');` and `downvoteButton.setLabel('⬇️') ;`
}
- My Code - src\commands\Other\suggest.js: https://sourceb.in/2ouGW3Vt8q - src\index.js: https://sourceb.in/fd8CWW0il7 Watch the video bellow for an example
2 replies