Question

Mobile how can we explicitly call the save function in preview page

Hi Community,

 

In Mobile, how can we explicitly call the save function in preview page. Our scenario is that we created a custom button in preview page then on click of that we will call the out of the box save function.

Like 0

Like

4 comments

Hello,

 

For example in your handler you need to add:

execute: function(record) {
        this.callParent(arguments);
		record.save({
			queryConfig: Ext.create("Terrasoft.QueryConfig", {
				isLogged: false,
				modelName: record.modelName
			}),
			success: function() {
				alert(11111);
			},
			failure: function(exception) {
				console.log(exception);
			}
		}, this);
        this.executionEnd(true);
    }

If you don't pass current record as an argument in your handler - you can get it by calling this.getRecord() and use the same approach.

Thanks Oleg,

 

I am able to call this function in Record Page. Now my problem is how to force record page reload after successful save?

Hello,



To refresh the record page, you can use the refreshDirtyData method which is described in detail here.

Thank you Artem



However we found out thate 

record.save function is only saving record changes. It is not saving the attachments. Any idea how to save record and attachments?
Show all comments