The SortListbox function is triggered in the HeaderPressed event handler of the WebListbox. If tempString "" And tempString str(tempString.val) And tempString.val 0 Then Me.ListIndex = 0 'highlight the first row TempString = ReplaceAll(tempString, " ", "") 'remove spaces These events, methods and properties are both common amongst the desktop, mobile and web versions of the control and are the most. For mobile, the iOSMobileTable provides the mobile-equivalent of a ListBox. TempString = ReplaceAll(tempString, ",", "") 'remove commas Xojo provides a ListBox control for desktop, mobile and web projects: DesktopListBox. TempString = Uppercase(Me.Cell(tempInt, tempInt2)) If sortColumn = tempInt2 And numericalColumn Then 'check If the chosen column is full of only numerical data Rec.Column("m圜olumn" + str(tempInt2)) = Me.Cell(tempInt, tempInt2) If fieldExistsInTable(memoryDB, "sortTable", "m圜ellTag" + Str(tempInt2)) Then rec.Column("m圜ellTag" + Str(tempInt2)) = Me.CellTag(tempInt, tempInt2) If fieldExistsInTable(memoryDB, "sortTable", "myRowTag") Then rec.Column("myRowTag") = Me.RowTag(tempInt) 'place the WebListBox data into the databaseįor tempInt As Integer = 0 to Me.RowCount - 1 rec = New DatabaseRecordįor tempInt2 As Integer = 0 to Me.ColumnCount - 1 If memoryDB.Error Then Return 'not sure why we got an error, but leave the table alone TempSQL = tempSQL + “extraSortColumnWAD DOUBLE” TempSQL = tempSQL + "m圜ellTag" + Str(tempInt) + " TEXT COLLATE NOCASE, " If Me.CellTag(0, tempInt).StringValue "" Then TempSQL = tempSQL + “m圜olumn” + str(tempInt) + " TEXT COLLATE NOCASE, " //Ajouter le cellTag TempSQL = tempSQL + “myRowTag” + " TEXT COLLATE NOCASE, "įor tempInt As Integer = 0 to Me.ColumnCount - 1 If rsf.Field(“ColumnName”).StringValue = fieldName Thenįunction 2 : SortListbox(sortColumn As Integer) Some comments are in french but you should find your way around…įunction 1 : fieldExistsInTable (db As SQLiteDatabase, tableName As String, fieldName As String) As Boolean Since they are zero, the loops only iterate once. What’s happening is that you’ve defined the Dim ColumnCount, RowCount As Integer variables, but they are both 0. Hopefully it can be usefull for someone… So thanks again to David Cox for creating the main part of this code. Sure I tend to go for the give enough information for someone to discover the solution approach, but am always happy to help if more is needed. It surely can be optimized and by the way, let me know if you do so :). I use two Functions in a subclassed WebListbox. It works well with Strings, dates and numbers. I modified David Cox 's function for sorting WebListBox ( Link to conversation) so it can take into account RowTags and CellTags as well.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |