lookinb.blogg.se

Xojo weblistbox sort
Xojo weblistbox sort












  1. XOJO WEBLISTBOX SORT FULL
  2. XOJO WEBLISTBOX SORT CODE

XOJO WEBLISTBOX SORT CODE

  • Smaller Projects and Applications: Because classes allow you to store code once and use it over and over in a project, your project and the resulting application is smaller in size and may require less memory.
  • If you create a class based on the PushButton control and then add your code to that class, any usage (instances) of that custom class will have that code. If you want to use the same code with another PushButton, you need to copy the code and then make changes to the code in case it refers to the original PushButton (since the new PushButton will have a different name than the original).Ĭlasses store the code once and refer to the object (like the PushButton) generically so that the same code can be reused any number of times without modification.
  • Reusable Code: When you directly add code to a PushButton on a Window to customize its behavior, you can only use that code with that one PushButton.
  • Classes are the fundamental building blocks of object-oriented programming. But unlike a module, a class provides better code reuse. The SortListbox function is triggered in the HeaderPressed event handler of the WebListbox.In its simplest form, a class is a container of code and data much like a module. If tempString "" And tempString str(tempString.val) And tempString.val 0 Then Me.ListIndex = 0 'highlight the first row

    xojo weblistbox sort

    TempString = ReplaceAll(tempString, " ", "") 'remove spaces TempString = ReplaceAll(tempString, ",", "") 'remove commas TempString = Uppercase(Me.Cell(tempInt, tempInt2)) If sortColumn = tempInt2 And numericalColumn Then

    XOJO WEBLISTBOX SORT FULL

    '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

    xojo weblistbox sort

    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 Hopefully it can be usefull for someone… So thanks again to David Cox for creating the main part of this code. It surely can be optimized and by the way, let me know if you do so :).

    xojo weblistbox sort

    I use two Functions in a subclassed WebListbox. It works well with Strings, dates and numbers.

    xojo weblistbox sort

    I modified David Cox 's function for sorting WebListBox ( Link to conversation) so it can take into account RowTags and CellTags as well.














    Xojo weblistbox sort