Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82284

Call rest service on field blur event and update editor fields

$
0
0

I'd need some explanations on what the workflow with dt and editor would be to add the features explained below.

In the table shown in the image, the user can insert values for columns Val A , B , E while adding a new row.
When the user digits a number (id) in "Val B" and triggers a blur event on that field , a REST api is called , which returns an object with values for columns "Val C", "Val D", and "Val G".
Otherwise, if the user doesn't remember/know the id , he can click the search button (next to the field) which opens a modal , where he can basically do the same kind of search. As he receives a response, he can choose a record which should update the same columns as if a blur event happened (Val C, D, G).

I've read the doc about the blur , but it seems it only applies to the editor form.
I've also read about dependent(), but couldn't figure out how to implement it (I may avoid using it , if I manage to manually update the editor data for the new row, maybe with a preEdit)

Questions are:
- How can i make the 3rd column show the search button on inlineCreate() ?
- How do I trigger a blur event which calls a REST service , and its result updates values of the editor data and immediately update the editor line?

Many thanks in advance!!


Viewing all articles
Browse latest Browse all 82284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>