masterCheckbox in datatable

Hello, I have a problem. Can someone help me?
How can I make the master checkboxes in the DataTable select all the checkboxes on the current page instead of only the displayed checkboxes, and the checkboxes on the previous pages are not selected.

webix.ui.datafilter.mCheckbox = webix.extend({
	refresh:function(master, node, config){
		node.onclick = function(){
			this.getElementsByTagName("input")[0].checked = config.checked = !config.checked;
			var column = master.getColumnConfig(config.columnId);
			var checked = config.checked ? column.checkValue : column.uncheckValue;
			master.data.each(function(obj){
				//getItemNode checks visibility, other code is default
				if(obj && master.getItemNode(obj.id)){ 
					obj[config.columnId] = checked;
					master.callEvent("onCheck", [obj.id, config.columnId, checked]);
					this.callEvent("onStoreUpdated", [obj.id, obj, "save"]);
				} 
			});
			master.refresh();
		};
	},
}, webix.ui.datafilter.masterCheckbox);

Hello @HaoyangChen,
If I understand you correctly, you need to handle the onAfterPageChange event of the Pager view and check/uncheck the master checkbox to synchonize it with page records.
Please take a look at the following example:
https://snippet.webix.com/blo37h2h

Thank you very much.

Thank you very much.

doesnt work. master doesnt sync