Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docs for select2_json_from_api #574

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Added docs for select2_json_from_api #574

merged 1 commit into from
Apr 30, 2024

Conversation

promatik
Copy link
Member

CRUD::field([
'label' => 'Airports', // Table column heading
'type' => 'select2_json_from_api',
'name' => 'airports', // a unique identifier (usually the method that defines the relationship in your Model)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'name' => 'airports', // a unique identifier (usually the method that defines the relationship in your Model)
'name' => 'airports', // field name / database column name

'label' => 'Airports', // Table column heading
'type' => 'select2_json_from_api',
'name' => 'airports', // a unique identifier (usually the method that defines the relationship in your Model)
'data_source' => url('airports/fetch/list'), // url to controller search function (with /{id} should return model)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'data_source' => url('airports/fetch/list'), // url to controller search function (with /{id} should return model)
'data_source' => url('airports/fetch/list'), // the endpoint the field will use


// OPTIONAL
'delay' => 500, // the minimum amount of time between ajax requests when searching in the field
'method' => 'POST', // route method, either GET or POST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'method' => 'POST', // route method, either GET or POST

@pxpm pxpm merged commit fda9d79 into master Apr 30, 2024
2 checks passed
@pxpm pxpm deleted the select2_json_from_api branch April 30, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants