In the previous chapters, we have gone through some examples of how to save data. We used Form submit
, Ajax request
, and also the writing resource from the store. In this chapter, let's focus on the functionalities we have not implemented yet. But don't worry, the complete implementation is available in the source code distributed with this book.
We have loaded a Form panel using the loadRecord
method. Let's try a different approach now. Let's try using the setValues
method. This is also useful because we have a CheckBox
group, and it can be a little tricky to load their values on the Form panel. So when the user selects a record from the Film grid panel and clicks on the Edit button, we will open the Edit window and load its values. For this reason, we need to listen to the click event of the Edit button and implement a method that receives the button
as parameter:
var grid = button.up('filmsgrid'), record = grid...