Sergio Castellari Active Member Licensed User Longtime User Sep 10, 2021 #1 Situation: A) I have a B4XTable view B) I need that by clicking on any of the columns, I can change the background color of the entire row. Basically what I want is for the USER to see which row was selected, showing it in another color. Greetings
Situation: A) I have a B4XTable view B) I need that by clicking on any of the columns, I can change the background color of the entire row. Basically what I want is for the USER to see which row was selected, showing it in another color. Greetings
Solution M M Mahares Sep 10, 2021 Sergio Castellari said: Basically what I want is for the USER to see which row was selected, showing it in another color. Click to expand... The easiest way Sergio is to use the extension class to B4XTable. Here is the link: [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com You would choose in your case: SINGLE_LINE_PERMANENT - selection of a single line. Code: Copy XSelections.Mode = XSelections.MODE_SINGLE_LINE_PERMANENT XSelections.SelectionColor=xui.Color_Green 'you can change the color of the row selected with this
Sergio Castellari said: Basically what I want is for the USER to see which row was selected, showing it in another color. Click to expand... The easiest way Sergio is to use the extension class to B4XTable. Here is the link: [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com You would choose in your case: SINGLE_LINE_PERMANENT - selection of a single line. Code: Copy XSelections.Mode = XSelections.MODE_SINGLE_LINE_PERMANENT XSelections.SelectionColor=xui.Color_Green 'you can change the color of the row selected with this
M Mahares Expert Licensed User Longtime User Sep 10, 2021 #2 Sergio Castellari said: Basically what I want is for the USER to see which row was selected, showing it in another color. Click to expand... The easiest way Sergio is to use the extension class to B4XTable. Here is the link: [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com You would choose in your case: SINGLE_LINE_PERMANENT - selection of a single line. Code: Copy XSelections.Mode = XSelections.MODE_SINGLE_LINE_PERMANENT XSelections.SelectionColor=xui.Color_Green 'you can change the color of the row selected with this Last edited: Sep 10, 2021 Upvote 3 Solution
Sergio Castellari said: Basically what I want is for the USER to see which row was selected, showing it in another color. Click to expand... The easiest way Sergio is to use the extension class to B4XTable. Here is the link: [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com You would choose in your case: SINGLE_LINE_PERMANENT - selection of a single line. Code: Copy XSelections.Mode = XSelections.MODE_SINGLE_LINE_PERMANENT XSelections.SelectionColor=xui.Color_Green 'you can change the color of the row selected with this
Sergio Castellari Active Member Licensed User Longtime User Sep 10, 2021 #3 Hello there @Mahares I have followed your suggestions Look at my surroundings: I think I have the correct libraries, however it doesn't recognize "B4XTableSelections" What I can be doing wrong? Download this example (and it works!): [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com Greetings and thanks! Upvote 0
Hello there @Mahares I have followed your suggestions Look at my surroundings: I think I have the correct libraries, however it doesn't recognize "B4XTableSelections" What I can be doing wrong? Download this example (and it works!): [B4X] B4XTableSelections - extended selection modes for B4XTable B4XTableSelections extends B4XTable and adds new selection modes: SINGLE_CELL_TEMP - this is the built-in selection mode. Unlike the other selection modes it disappears automatically. SINGLE_CELL_PERMANENT - selection of a single cell. SINGLE_LINE_PERMANENT - selection of a single line... www.b4x.com Greetings and thanks!
M Mahares Expert Licensed User Longtime User Sep 10, 2021 #4 Sergio Castellari said: What I can be doing wrong? Click to expand... You need to add the class module manually to your project from the B4J example in the link I gave you. The class module is called: B4XTableSelections.bas. This class module works with B4A also. There is no library to check Upvote 1
Sergio Castellari said: What I can be doing wrong? Click to expand... You need to add the class module manually to your project from the B4J example in the link I gave you. The class module is called: B4XTableSelections.bas. This class module works with B4A also. There is no library to check
Sergio Castellari Active Member Licensed User Longtime User Sep 10, 2021 #5 UPS!!!! My ignorance believed that it was included in "B4XCollections" Adding "B4XTablesSelections.bas" came out working !!!! It is also necessary to clarify that the following must be done (in addition to what you indicate above): Code: Copy Sub B4XTable1_DataUpdated ... XSelections.Refresh End Sub Refresh the display when we change pages Code: Copy Private Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long) XSelections.CellClicked(ColumnId, RowId) : Sleep(150) ... End Sub and we paint the row when selecting it A million THANKS @Mahares Upvote 0
UPS!!!! My ignorance believed that it was included in "B4XCollections" Adding "B4XTablesSelections.bas" came out working !!!! It is also necessary to clarify that the following must be done (in addition to what you indicate above): Code: Copy Sub B4XTable1_DataUpdated ... XSelections.Refresh End Sub Refresh the display when we change pages Code: Copy Private Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long) XSelections.CellClicked(ColumnId, RowId) : Sleep(150) ... End Sub and we paint the row when selecting it A million THANKS @Mahares