Skip to content

Commit 3d95bff

Browse files
authored
Merge pull request #63 from MayaKirova/bug-245365
Fix for bug 245365: ARD sample cannot load
2 parents 79dcee5 + 396984d commit 3d95bff

1 file changed

Lines changed: 21 additions & 39 deletions

File tree

HTMLSamples/grid/append-rows-on-demand.html

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<title>$$(Title_append-rows-on-demand)</title>
@@ -17,6 +17,8 @@
1717

1818
<script src="%%jsrender%%" type="text/javascript"></script>
1919

20+
<script src="../../../../data-files/adventureworks.min.js"></script>
21+
2022
<style type="text/css">
2123
.tweet-user {
2224
font-size: 14px;
@@ -78,39 +80,23 @@ <h3>$$(AppendRowsOnDemand_Button_Caption)</h3>
7880
}
7981
});
8082

81-
//Hide the button after all data is loaded.
82-
$(document).delegate("#buttonAppendRowsOnDemand", "iggridrendered", function (evt, ui) {
83-
$("#buttonAppendRowsOnDemand_loadMoreButton").click(function () {
84-
var totalRecCount = $("#buttonAppendRowsOnDemand").data("igGrid").dataSource.totalRecordsCount();
85-
var currentRecCount = $("#buttonAppendRowsOnDemand").data("igGrid").dataSource.totalLocalRecordsCount();
86-
var chunkSize = $("#buttonAppendRowsOnDemand").igGridAppendRowsOnDemand("option", "chunkSize");
87-
if (totalRecCount <= currentRecCount + chunkSize) {
88-
$("#buttonAppendRowsOnDemand_loadMoreButton").hide();
89-
}
90-
});
91-
});
92-
9383
$('#autoAppendRowsOnDemand').igGrid({
94-
dataSource: 'https://www.igniteui.com/api/tweets?callback=?',
95-
responseDataKey: 'd.results.Records',
96-
autoGenerateColumns: false,
84+
dataSource: adventureWorks,
85+
autoGenerateColumns: false,
86+
columns: [
87+
{ headerText: "$$(AdventureWorks_Products_Name)", key: "Name", dataType: "string", width: "20%" },
88+
{ headerText: "$$(AdventureWorks_Products_ProductNumber)", key: "ProductNumber", dataType: "string", width: "20%" },
89+
{ headerText: "$$(AdventureWorks_Products_MakeFlag)", key: "MakeFlag", dataType: "bool", width: "10%" },
90+
{ headerText: "$$(AdventureWorks_Products_ReorderPoint)", key: "ReorderPoint", dataType: "number", width: "10%" },
91+
{ headerText: "$$(AdventureWorks_Products_SellStartDate)", key: "SellStartDate", dataType: "date", width: "15%" }
92+
],
9793
enableUTCDates: true,
98-
columns: [
99-
{
100-
unbound: true,
101-
key: 'Tweets',
102-
headerText: 'Infragistics Tweets',
103-
template: '<div style=\'float:left\'><img src=\'../../images/ig_twitter_logo.png\' ></img></div><div class=\'tweet\'><p style=\'height:20px\'><span class=\'tweet-user\'>{{>User.Name}}</span><span class=\'tweet-screen-name\'>@{{>ScreenName}}</span><span class=\'tweet-date\'>{{>#view.hlp(\'formatDate\')(CreatedAt)}}</span></p><p class=\'tweet-text\'>{{>Text}}</p></div>'
104-
}
105-
],
10694
features: [
10795
{
108-
recordCountKey: 'd.results.TotalRecordsCount',
10996
chunkIndexUrlKey: 'page',
11097
chunkSizeUrlKey: 'pageSize',
11198
name: 'AppendRowsOnDemand',
112-
loadTrigger: 'auto',
113-
type: 'remote'
99+
loadTrigger: 'auto'
114100
}
115101
],
116102
width: '100%',
@@ -119,26 +105,22 @@ <h3>$$(AppendRowsOnDemand_Button_Caption)</h3>
119105
});
120106

121107
$('#buttonAppendRowsOnDemand').igGrid({
122-
dataSource: 'https://www.igniteui.com/api/tweets?callback=?',
123-
responseDataKey: 'd.results.Records',
108+
dataSource: adventureWorks,
124109
autoGenerateColumns: false,
125110
enableUTCDates: true,
126111
columns: [
127-
{
128-
unbound: true,
129-
key: 'Tweets',
130-
headerText: 'Infragistics Tweets',
131-
template: '<div style=\'float:left\'><img src=\'../../images/ig_twitter_logo.png\' ></img></div><div class=\'tweet\'><p style=\'height:20px\'><span class=\'tweet-user\'>{{>User.Name}}</span><span class=\'tweet-screen-name\'>@{{>ScreenName}}</span><span class=\'tweet-date\'>{{>#view.hlp(\'formatDate\')(CreatedAt)}}</span></p><p class=\'tweet-text\'>{{>Text}}</p></div>'
132-
}
133-
],
112+
{ headerText: "$$(AdventureWorks_Products_Name)", key: "Name", dataType: "string", width: "20%" },
113+
{ headerText: "$$(AdventureWorks_Products_ProductNumber)", key: "ProductNumber", dataType: "string", width: "20%" },
114+
{ headerText: "$$(AdventureWorks_Products_MakeFlag)", key: "MakeFlag", dataType: "bool", width: "10%" },
115+
{ headerText: "$$(AdventureWorks_Products_ReorderPoint)", key: "ReorderPoint", dataType: "number", width: "10%" },
116+
{ headerText: "$$(AdventureWorks_Products_SellStartDate)", key: "SellStartDate", dataType: "date", width: "15%" }
117+
],
134118
features: [
135119
{
136-
recordCountKey: 'd.results.TotalRecordsCount',
137120
chunkIndexUrlKey: 'page',
138121
chunkSizeUrlKey: 'pageSize',
139122
name: 'AppendRowsOnDemand',
140-
loadTrigger: 'button',
141-
type: 'remote'
123+
loadTrigger: 'button'
142124
}
143125
],
144126
width: '100%',

0 commit comments

Comments
 (0)