Created
January 9, 2023 06:17
-
-
Save tabacitu/3c1de6b48c5b9fa735f23ea0ec46292d to your computer and use it in GitHub Desktop.
Example for using the CrudField JS API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crud.field('owners').subfield('owner_id').onChange(function(subfield) { | |
// TODO: do an AJAX call to an API you control; | |
// the easiest would be to make a call to the FetchOperation on the same CrudController | |
let ownerId = subfield.value; | |
let theValueYouWantToSet = 'something'; | |
crud.field('owners').subfield('nick', subfield.rowNumber).input.value = theValueYouWantToSet; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment