Posted 5 December 2018, 11:58 pm EST
Hi,
Regards the AutoComplete,
The 10 items can be shown on initialization and the items can be queried on type. For now on clearing text, the ItemsSourceFunction do not get triggered, hence initial item can be shown.
Please refer to the following code snippet for above:
function FetchItemsSource(query, max, callback) {
if (!query) {
var url = 'https://services.odata.org/V4/Northwind/Northwind.svc/Products';
wijmo.httpRequest(url, {
data: {
$format: 'json',
$select: 'ProductID,ProductName',
$count: true,
$skip: 0,
$top: 10
},
success: function (xhr) {
var response = JSON.parse(xhr.response);
var arr = response.d ? response.d.results : response.value;
callback(response.value);
}
});
return;
}
var url = 'https://services.odata.org/V4/Northwind/Northwind.svc/Products';
wijmo.httpRequest(url, {
data: {
$format: 'json',
$select: 'ProductID,ProductName',
$filter: 'indexof(ProductName, \'' + query + '\') gt -1',
$count: true,
$top: 10
},
success: function (xhr) {
var response = JSON.parse(xhr.response);
var arr = response.d ? response.d.results : response.value;
callback(response.value);
}
});
}
@Html.C1().AutoComplete().Id("sdf").DisplayMemberPath("ProductName").ItemsSourceFunction("FetchItemsSource").MaxItems(10)
Regards FlexGrid,
The edited items are 0 since the CollectionView track changes are set to false as default. If you set it to true, you will get the edited item.
Please refer to the following code snippet:
var grid = wijmo.Control.getControl("#grid");
cv = grid.collectionView;
cv.trackChanges = true;
document.getElementById("getChange").addEventListener("click", function () {
console.log(cv);
});
~Manish