Skip to content

Commit f285a09

Browse files
committed
Use appPathBase variable on the page
1 parent 96540b7 commit f285a09

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

AspNetCore/Razor-Mvc/Razor.AdvancedSearch/Pages/Index.cshtml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
@{
88
ViewData["Title"] = "Advanced Search demo";
9+
var appPathBase = Configuration["appPathBase"] ?? "";
910
}
1011

1112
@section Styles {
@@ -139,27 +140,29 @@
139140
}
140141
}
141142
142-
const view = new easyquery.ui.AdvancedSearchView()
143-
const context = view.getContext()
144-
context.useEnterprise(function () {
145-
view.init(viewOptions)
146-
})
143+
const view = new easyquery.ui.AdvancedSearchView();
144+
const context = view.getContext();
145+
context
146+
.useEndpoint('@(appPathBase)/api/easyquery') // Middleware endpoint
147+
.useEnterprise(function () {
148+
view.init(viewOptions)
149+
});
147150
148151
context.addEventListener('ready', () => {
149152
console.log('EasyQuery is ready')
150-
})
153+
});
151154
152155
context.addEventListener('syncQuery', ()=> {
153156
const qn = document.getElementById('query-name')
154157
qn.innerHTML = context.query.getName()
155-
})
158+
});
156159
157-
document['AdvancedSearchView'] = view
160+
document['AdvancedSearchView'] = view;
158161
159162
const execButton = document.getElementById('ExecQueryButton')
160163
execButton.addEventListener('click', function () {
161164
view.fetchData()
162-
})
165+
});
163166
})
164167
</script>
165168
}

0 commit comments

Comments
 (0)