Open query plan link when select XML showplan in the result grid (#1092)

* open query plan link

* address comments
This commit is contained in:
Abbie Petchtes
2018-04-09 10:27:32 -07:00
committed by GitHub
parent 849653927a
commit 5ac89e5a49

View File

@@ -477,7 +477,13 @@ export abstract class GridParentComponent {
*/
xmlLinkHandler = (cellRef: string, row: number, dataContext: JSON, colDef: any) => {
const self = this;
self.handleLink(cellRef, row, dataContext, colDef, 'xml');
let value = self.getCellValueString(dataContext, colDef);
if (value.startsWith('<ShowPlanXML') && colDef.name !== 'XML Showplan') {
self.handleQueryPlanLink(cellRef, value);
} else {
self.handleLink(cellRef, row, dataContext, colDef, 'xml');
}
}
/**
@@ -488,6 +494,13 @@ export abstract class GridParentComponent {
self.handleLink(cellRef, row, dataContext, colDef, 'json');
}
private handleQueryPlanLink(cellRef: string, value: string): void {
const self = this;
$(cellRef).children('.xmlLink').click(function (): void {
self._bootstrapService.queryEditorService.newQueryPlanEditor(value);
});
}
private handleLink(cellRef: string, row: number, dataContext: JSON, colDef: any, linkType: string): void {
const self = this;
let value = self.getCellValueString(dataContext, colDef);