define(['jQuery'], function ($) {
var query = {
StartIndex: 0,
Limit: 100000
};
var currentResult;
function reloadList(page) {
Dashboard.showLoadingMsg();
ApiClient.getSmartMatchInfos(query).then(function (infos) {
currentResult = infos;
populateList(page, infos);
Dashboard.hideLoadingMsg();
}, function () {
Dashboard.hideLoadingMsg();
});
}
function populateList(page, result) {
var infos = result.Items;
if (infos.length > 0) {
infos = infos.sort(function (a, b) {
a = a.OrganizerType + " " + (a.DisplayName || a.ItemName);
b = b.OrganizerType + " " + (b.DisplayName || b.ItemName);
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
});
}
var html = "";
if (infos.length) {
html += '
';
}
for (var i = 0, length = infos.length; i < length; i++) {
var info = infos[i];
html += '';
html += '';
html += (info.DisplayName || info.ItemName);
html += '';
var matchStringIndex = 0;
html += info.MatchStrings.map(function (m) {
var matchStringHtml = '';
matchStringHtml += '';
matchStringHtml += '';
matchStringHtml += "