sgrebnov / cordova-plugin-azure-notificationhub

Apache License 2.0
11 stars 36 forks source link

Kendo Listview fixed headers with WebSQL Storage??? #8

Open Iknuts opened 9 years ago

Iknuts commented 9 years ago

Hi, ive been able to get the Kendo listview + WebSQL Datasource to work without issue for the most part. Problem is, when i try and add group options, the list refuses to build. i suspect im placing the code in the wrong section, but im not even sure kendo supports it. Anyone managed to get this to work?

heres my code for retrieving for webSQL datastore:

if (db) { var dataSource = new kendo.data.DataSource.create({ transport: { read: function (options) {

                       db.transaction(function (tx) {

                           tx.executeSql('SELECT * from Applications', [], function (tx, result) {

                               var data = [];
                               var custom = [];
                               // copy the rows to a regular array
                               for (var i = 0; i < result.rows.length; i++) {
                                   data[i] = result.rows.item(i);

                                   // create a new datasource with custom visual elements
                                   db.transaction(function (tx1) {

                                   });
                               }

                               options.success(data); // return the data back to the data source
                           });
                       });
                   }
               }, 

           });

           viewApplications(dataSource);

       }

AND FOR THE INITIALIZATION

function viewApplications(datasource) { try{ $("#application-list").kendoMobileListView({ dataSource: datasource, // group: "bizName", pullToRefresh: false, template: $("#application-template").html(),

            headerTemplate: "<h2>${bizName}</h2>",
            fixedHeaders: true,

            click: function (e) {
                $('.appOptions').show();
                $('#appOptions-add').hide();
                setListClick(e.dataItem.RefNo,e.dataItem.BizId,e.dataItem.ApplicantId);

            },
            create:function(e){
                console.log(e.dataItem.BizId);

            }

        });
    }
    catch (e) {
     alert(e);
    }

}