主要代码:

var grid = this.comp("grid1");
grid.setGridParam({sortname:"字段",sortorder:"desc"});
grid.refresh();