1
00:00:00,180 --> 00:00:01,110
Hello, my dear friend.

2
00:00:01,150 --> 00:00:06,240
So we will try to load the table for our employees this time round.

3
00:00:07,020 --> 00:00:08,160
We'll just jump right in.

4
00:00:10,260 --> 00:00:17,430
So first up, want to remove these comments, so let's go back to manage employees and let's set all

5
00:00:17,430 --> 00:00:18,150
of this up.

6
00:00:23,790 --> 00:00:26,770
So we'll first create a method.

7
00:00:28,070 --> 00:00:29,240
Because it looks nicer.

8
00:00:29,780 --> 00:00:30,260
I'll show you.

9
00:00:32,380 --> 00:00:33,540
Death in it.

10
00:00:33,580 --> 00:00:34,420
Table South.

11
00:00:40,010 --> 00:00:48,320
Right here, we've got to get an instance or database so self-taught DB is equal to database, which

12
00:00:48,320 --> 00:00:49,910
we will have to import.

13
00:00:54,410 --> 00:00:57,380
From database import database.

14
00:00:59,600 --> 00:01:02,990
We cannot actually import all of the widgets.

15
00:01:03,050 --> 00:01:08,780
So from Picardy, five Dot Kudi widgets import everything.

16
00:01:11,270 --> 00:01:13,760
Now let's get the results from the database.

17
00:01:14,840 --> 00:01:21,650
So we'll do an employee list is equal to self TVB dot, get employee info.

18
00:01:26,420 --> 00:01:35,270
And we'll populate the Heter list so hetter list is equal to employee list of zero because that's what

19
00:01:35,270 --> 00:01:42,290
we return from this method and the value list is equal to employee list of one.

20
00:01:48,210 --> 00:01:55,530
Now it's get the number of rows, so the number of rows is equal to land value list.

21
00:01:59,510 --> 00:02:03,980
And the number of columns is equal to Len header list.

22
00:02:08,390 --> 00:02:16,580
So now we can feel the table with it, right, so we can access it like this self-taught UI dot table

23
00:02:16,580 --> 00:02:17,120
widget.

24
00:02:19,300 --> 00:02:22,390
And we need this set the road column.

25
00:02:22,930 --> 00:02:25,630
The column count, the road count.

26
00:02:26,320 --> 00:02:30,420
So the column count, the labels and the actual data that we want to display.

27
00:02:30,430 --> 00:02:33,460
So set ro count number of road.

28
00:02:34,850 --> 00:02:40,340
Self UI taught table widget set column count number of columns.

29
00:02:50,880 --> 00:03:00,960
We'll need to send the list that we need to access so self-taught you aiport table widget set, horizontal

30
00:03:01,680 --> 00:03:03,060
header labels.

31
00:03:04,620 --> 00:03:05,400
Radio.

32
00:03:07,300 --> 00:03:09,520
This function happens to be a temple.

33
00:03:09,970 --> 00:03:12,520
So Temple had list.

34
00:03:17,070 --> 00:03:18,690
And what else do we want?

35
00:03:19,860 --> 00:03:23,850
Well, actually, we just want to select the one row.

36
00:03:24,540 --> 00:03:31,470
So for that self-taught you, I thought table widget, not set selection mode.

37
00:03:32,810 --> 00:03:39,770
All right, so we can select multiple rows or we could only select one room, but for now will select

38
00:03:39,770 --> 00:03:43,130
only one room and we just access by.

39
00:03:44,120 --> 00:03:48,140
Q Abstract item view, not a single selection.

40
00:03:49,620 --> 00:03:51,720
So now we just load the data into the table.

41
00:03:53,790 --> 00:04:01,680
For each row in range of number of rows and for column B, range of number of columns.

42
00:04:10,950 --> 00:04:16,740
We can set the item by using self-taught UI dot table widget set item.

43
00:04:19,580 --> 00:04:27,230
And we have the row index column index and cue table widget item, which contains a value that we have

44
00:04:27,230 --> 00:04:27,980
to display.

45
00:04:28,700 --> 00:04:34,200
So row column and queue table widget item.

46
00:04:36,360 --> 00:04:42,870
Which receives a string as a parameter, so we need to cast value list and row and column.

47
00:04:43,970 --> 00:04:45,710
And we need to do is call the function.

48
00:04:46,800 --> 00:04:48,540
So self not in it.

49
00:04:48,750 --> 00:04:49,230
Table.

50
00:04:51,500 --> 00:04:57,320
Now, why don't we just try to run the program so choose manage employee?

51
00:04:59,450 --> 00:05:06,260
OK, so all this information looks like is being displayed correctly, but can you see here that the

52
00:05:06,260 --> 00:05:09,530
headers and the values don't really stretch the end of the table?

53
00:05:10,520 --> 00:05:11,050
But guess what?

54
00:05:11,060 --> 00:05:12,620
We do have a function to do that.

55
00:05:13,040 --> 00:05:14,210
So let's go back and do it.

56
00:05:18,090 --> 00:05:27,480
Self-taught UI, actable widget dot horizontal header set section, resize mode queue header view dot

57
00:05:27,720 --> 00:05:28,440
stretch.

58
00:05:40,440 --> 00:05:42,690
Now have a look at what it does.

59
00:05:43,800 --> 00:05:45,900
And you see how the table is now showing correctly.

60
00:05:48,490 --> 00:05:49,990
So what else can we do?

61
00:05:50,440 --> 00:05:55,180
Well, we can now see that we can select two columns separately.

62
00:05:56,500 --> 00:06:00,490
So what we want to do, though, is select a whole row.

63
00:06:01,550 --> 00:06:02,260
How do we do that?

64
00:06:02,470 --> 00:06:02,830
Well.

65
00:06:08,320 --> 00:06:16,960
Self-taught Eweida table widget set selection behavior cue abstract item view dot select rose.

66
00:06:25,100 --> 00:06:29,900
Now, another thing that we can do is we can have a vertical header display here.

67
00:06:30,710 --> 00:06:31,790
We can also hide it.

68
00:06:33,930 --> 00:06:38,280
So self dot UI dot table widget, vertical header naugahyde.

69
00:06:39,410 --> 00:06:42,170
So run it again and look at that.

70
00:06:43,430 --> 00:06:47,900
So that's it for this, we have now loaded our employee table.

71
00:06:47,900 --> 00:06:48,640
Looks pretty good.

72
00:06:48,650 --> 00:06:50,630
So I want to see you in the next video.

73
00:06:51,110 --> 00:06:52,220
Till then, have a nice day.
