Hey guys,
I’m currently working on a print button to print a listGrid/treeGrid which uses a dataSource. To do that, I used the function “Canvas.getPrintHTML([printProperties, callback])”. What I noticed, though, is that the callback only fires if there is a certain amount of items loaded from the dataSource (see .gif below). The SmartClient reference says “the default getPrintHTML() implementation always returns null and fires the callback when a callback is provided”, so there shouldn’t be a case where the callback is not fired, right?
My test data
The code I used
For testing, I used the nightly 2015-09-23 of SmartClient and Firefox 40.0.3
If you have any further question, please ask!
Thanks in advance for your support!
Best Regards
I’m currently working on a print button to print a listGrid/treeGrid which uses a dataSource. To do that, I used the function “Canvas.getPrintHTML([printProperties, callback])”. What I noticed, though, is that the callback only fires if there is a certain amount of items loaded from the dataSource (see .gif below). The SmartClient reference says “the default getPrintHTML() implementation always returns null and fires the callback when a callback is provided”, so there shouldn’t be a case where the callback is not fired, right?
My test data
Code:
testData = [{ "number" : "1" }, { "number" : "2" }, { "number" : "3" }, { "number" : "4" }, { "number" : "5" }, { "number" : "6" }, { "number" : "7" }, { "number" : "8" }, { "number" : "9" }, { "number" : "10" }, { "number" : "11" }, { "number" : "12" }, { "number" : "13" }, { "number" : "14" }, { "number" : "15" }, { "number" : "16" }, { "number" : "17" }, { "number" : "18" }, { "number" : "19" }, { "number" : "20" }, { "number" : "21" }, { "number" : "22" }, { "number" : "23" }, { "number" : "24" }, { "number" : "25" }, { "number" : "26" }, { "number" : "27" }, { "number" : "28" }, { "number" : "29" }, { "number" : "30" }, { "number" : "31" }, { "number" : "32" }, { "number" : "33" }, { "number" : "34" }, { "number" : "35" }, { "number" : "36" }, { "number" : "37" }, { "number" : "38" }, { "number" : "39" }, { "number" : "40" }, { "number" : "41" }, { "number" : "42" }, { "number" : "43" }, { "number" : "44" }, { "number" : "45" }, { "number" : "46" }, { "number" : "47" }, { "number" : "48" }, { "number" : "49" }, { "number" : "50" }, { "number" : "51" }, { "number" : "52" }, { "number" : "53" }, { "number" : "54" }, { "number" : "55" }, { "number" : "56" }, { "number" : "57" }, { "number" : "58" }, { "number" : "59" }, { "number" : "60" }, { "number" : "61" }, { "number" : "62" }, { "number" : "63" }, { "number" : "64" }, { "number" : "65" }, { "number" : "66" }, { "number" : "67" }, { "number" : "68" }, { "number" : "69" }, { "number" : "70" }, { "number" : "71" }, { "number" : "72" }, { "number" : "73" }, { "number" : "74" }, { "number" : "75" }, { "number" : "76" }, { "number" : "77" }, { "number" : "78" }, { "number" : "79" }, { "number" : "80" }, { "number" : "81" }, { "number" : "82" }, { "number" : "83" }, { "number" : "84" }, { "number" : "85" }, { "number" : "86" }, { "number" : "87" }, { "number" : "88" }, { "number" : "89" }, { "number" : "90" }, { "number" : "91" }, { "number" : "92" }, { "number" : "93" }, { "number" : "94" }, { "number" : "95" }, { "number" : "96" }, { "number" : "97" }, { "number" : "98" }, { "number" : "99" }, { "number" : "100" }, { "number" : "101" }, { "number" : "102" }, { "number" : "103" }, { "number" : "104" }, { "number" : "105" }, { "number" : "106" }, { "number" : "107" }, { "number" : "108" }, { "number" : "109" }, { "number" : "110" }, { "number" : "111" }, { "number" : "112" }, { "number" : "113" }, { "number" : "114" }, { "number" : "115" }, { "number" : "116" }, { "number" : "117" }, { "number" : "118" }, { "number" : "119" }, { "number" : "120" }, { "number" : "121" }, { "number" : "122" }, { "number" : "123" }, { "number" : "124" }, { "number" : "125" }, { "number" : "126" }, { "number" : "127" }, { "number" : "128" }, { "number" : "129" }, { "number" : "130" }, { "number" : "131" }, { "number" : "132" }, { "number" : "133" }, { "number" : "134" }, { "number" : "135" }, { "number" : "136" }, { "number" : "137" }, { "number" : "138" }, { "number" : "139" }, { "number" : "140" }, { "number" : "141" }, { "number" : "142" }, { "number" : "143" }, { "number" : "144" }, { "number" : "145" }, { "number" : "146" }, { "number" : "147" }, { "number" : "148" }, { "number" : "149" }, { "number" : "150" }, { "number" : "151" }, { "number" : "152" }, { "number" : "153" }, { "number" : "154" }, { "number" : "155" }, { "number" : "156" }, { "number" : "157" }, { "number" : "158" }, { "number" : "159" }, { "number" : "160" }, { "number" : "161" }, { "number" : "162" }, { "number" : "163" }, { "number" : "164" }, { "number" : "165" }, { "number" : "166" }, { "number" : "167" }, { "number" : "168" }, { "number" : "169" }, { "number" : "170" }, { "number" : "171" }, { "number" : "172" }, { "number" : "173" }, { "number" : "174" }, { "number" : "175" }, { "number" : "176" }, { "number" : "177" }, { "number" : "178" }, { "number" : "179" }, { "number" : "180" }, { "number" : "181" }, { "number" : "182" }, { "number" : "183" }, { "number" : "184" }, { "number" : "185" }, { "number" : "186" }, { "number" : "187" }, { "number" : "188" }, { "number" : "189" }, { "number" : "190" }, { "number" : "191" }, { "number" : "192" }, { "number" : "193" }, { "number" : "194" }, { "number" : "195" }, { "number" : "196" }, { "number" : "197" }, { "number" : "198" }, { "number" : "199" }, { "number" : "200" }, { "number" : "201" }, { "number" : "202" }, { "number" : "203" }, { "number" : "204" }, { "number" : "205" }, { "number" : "206" }, { "number" : "207" }, { "number" : "208" }, { "number" : "209" }, { "number" : "210" }, { "number" : "211" }, { "number" : "212" }, { "number" : "213" }, { "number" : "214" }, { "number" : "215" }, { "number" : "216" }, { "number" : "217" }, { "number" : "218" }, { "number" : "219" }, { "number" : "220" }, { "number" : "221" }, { "number" : "222" }, { "number" : "223" }, { "number" : "224" }, { "number" : "225" }, { "number" : "226" }, { "number" : "227" }, { "number" : "228" }, { "number" : "229" }, { "number" : "230" }, { "number" : "231" }, { "number" : "232" }, { "number" : "233" }, { "number" : "234" }, { "number" : "235" }, { "number" : "236" }, { "number" : "237" }, { "number" : "238" }, { "number" : "239" }, { "number" : "240" }, { "number" : "241" }, { "number" : "242" }, { "number" : "243" }, { "number" : "244" }, { "number" : "245" }, { "number" : "246" }, { "number" : "247" }, { "number" : "248" }, { "number" : "249" }, { "number" : "250" }, { "number" : "251" }, { "number" : "252" }, { "number" : "253" }, { "number" : "254" }, { "number" : "255" }, { "number" : "256" }, { "number" : "257" }, { "number" : "258" }, { "number" : "259" }, { "number" : "260" }, { "number" : "261" }, { "number" : "262" }, { "number" : "263" }, { "number" : "264" }, { "number" : "265" }, { "number" : "266" }, { "number" : "267" }, { "number" : "268" }, { "number" : "269" }, { "number" : "270" }, { "number" : "271" }, { "number" : "272" }, { "number" : "273" }, { "number" : "274" }, { "number" : "275" }, { "number" : "276" }, { "number" : "277" }, { "number" : "278" }, { "number" : "279" }, { "number" : "280" }, { "number" : "281" }, { "number" : "282" }, { "number" : "283" }, { "number" : "284" }, { "number" : "285" }, { "number" : "286" }, { "number" : "287" }, { "number" : "288" }, { "number" : "289" }, { "number" : "290" }, { "number" : "291" }, { "number" : "292" }, { "number" : "293" }, { "number" : "294" }, { "number" : "295" }, { "number" : "296" }, { "number" : "297" }, { "number" : "298" }, { "number" : "299" }, { "number" : "300" } ];
Code:
isc.HLayout.create({ width : "100%", height : "100%", "members" : [isc.VLayout.create({ "members" : [isc.ToolStrip.create({ "members" : [isc.Button.create({ width : 230, "click" : function () { var printHTML = listGrid.getPrintHTML({}, function (data) { isc.say("Callback function called"); }); if (printHTML != null) { isc.warn("Callback function not called") }; }, "title" : "Print", }) ] }), isc.ListGrid.create({ "ID" : "listGrid", "width" : "100%", "height" : "100%", dataSource : isc.DataSource.create({ "fields" : [{ "name" : "number", "title" : "number", "type" : "string" } ], "dataFormat" : "json", "testData" : testData, "clientOnly" : true }), "autoFetchData" : true, "dataPageSize" : 30, "fields" : [{ "name" : "number", "title" : "number", "type" : "text", } ] }) ] }) ] })
If you have any further question, please ask!
Thanks in advance for your support!
Best Regards
Comment