Giter Club home page Giter Club logo

Comments (16)

fluk053 avatar fluk053 commented on July 2, 2024

List columns = [
PlutoColumn(
title: '',
field: 'Tps_field',
width: 100,
type: PlutoColumnType.text(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '900',
field: 'tps900_field',
width: 60,
type: PlutoColumnType.number(),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1000',
field: 'tps1000_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1100',
field: 'tps1100_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1200',
field: 'tps1200_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1300',
field: 'tps1300_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1400',
field: 'tps1400_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1500',
field: 'tps1500_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1600',
field: 'tps1600_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1700',
field: 'tps1700_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1800',
field: 'tps1800_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '1900',
field: 'tps1900_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2000',
field: 'tps2000_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2100',
field: 'tps2100_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2200',
field: 'tps2200_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2300',
field: 'tps2300_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2400',
field: 'tps2400_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2500',
field: 'tps2500_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2600',
field: 'tps2600_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2700',
field: 'tps2700_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2800',
field: 'tps2800_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '2900',
field: 'tps2900_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3000',
field: 'tps3000_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3100',
field: 'tps3100_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3200',
field: 'tps3200_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3300',
field: 'tps3300_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3400',
field: 'tps3400_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3500',
field: 'tps3500_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3600',
field: 'tps3600_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3700',
field: 'tps3700_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3800',
field: 'tps3800_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '3900',
field: 'tps3900_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4000',
field: 'tps4000_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4100',
field: 'tps4100_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4200',
field: 'tps4200_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4300',
field: 'tps4300_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4400',
field: 'tps4400_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4500',
field: 'tps4500_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
PlutoColumn(
title: '4600',
field: 'tps4600_field',
width: 60,
type: PlutoColumnType.number(readOnly: true),
enableDraggable: false,
enableSorting: false,
enableContextMenu: false,
),
];

List rows = [
PlutoRow(
cells: {
'Tps_field': PlutoCell(value: 'TPS 1'),
'tps900_field': PlutoCell(value: 0),
'tps1000_field': PlutoCell(value: 0),
'tps1100_field': PlutoCell(value: 0),
'tps1200_field': PlutoCell(value: 0),
'tps1300_field': PlutoCell(value: 0),
'tps1400_field': PlutoCell(value: 0),
'tps1500_field': PlutoCell(value: 0),
'tps1600_field': PlutoCell(value: 0),
'tps1700_field': PlutoCell(value: 0),
'tps1800_field': PlutoCell(value: 0),
'tps1900_field': PlutoCell(value: 0),
'tps2000_field': PlutoCell(value: 0),
'tps2100_field': PlutoCell(value: 0),
'tps2200_field': PlutoCell(value: 0),
'tps2300_field': PlutoCell(value: 0),
'tps2400_field': PlutoCell(value: 0),
'tps2500_field': PlutoCell(value: 0),
'tps2600_field': PlutoCell(value: 0),
'tps2700_field': PlutoCell(value: 0),
'tps2800_field': PlutoCell(value: 0),
'tps2900_field': PlutoCell(value: 0),
'tps3000_field': PlutoCell(value: 0),
'tps3100_field': PlutoCell(value: 0),
'tps3200_field': PlutoCell(value: 0),
'tps3300_field': PlutoCell(value: 0),
'tps3400_field': PlutoCell(value: 0),
'tps3500_field': PlutoCell(value: 0),
'tps3600_field': PlutoCell(value: 0),
'tps3700_field': PlutoCell(value: 0),
'tps3800_field': PlutoCell(value: 0),
'tps3900_field': PlutoCell(value: 0),
'tps4000_field': PlutoCell(value: 0),
'tps4100_field': PlutoCell(value: 0),
'tps4200_field': PlutoCell(value: 0),
'tps4300_field': PlutoCell(value: 0),
'tps4400_field': PlutoCell(value: 0),
'tps4500_field': PlutoCell(value: 0),
'tps4600_field': PlutoCell(value: 0),
},
),
];

Container(
alignment: Alignment.center,
height: 500,
width: 2400,
padding: const EdgeInsets.all(5),
child: PlutoGrid(
configuration: PlutoConfiguration(
columnTextStyle: const TextStyle(
color: Colors.black,
decoration: TextDecoration.none,
fontSize: 15,
fontWeight: FontWeight.w600,
),
cellTextStyle: const TextStyle(
color: Colors.black,
fontSize: 15,
),
// gridBorderColor: Colors.red,
// activatedBorderColor: Colors.red,
// borderColor: Colors.yellow,
),
columns: columns,
rows: rows,
onChanged: (PlutoOnChangedEvent event) {
print('test2');
print(event);
},
onLoaded: (PlutoOnLoadedEvent event) {
print('test1');
//stateManager.setEditing(true);
//event.stateManager.setSelectingMode(PlutoSelectingMode.Square);
print(event);
},
),
),

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

In onLoaded assign event.stateManager to the state variable. And when necessary, you can get the currently selected Rows, Cells, etc.

If you have more questions, please leave a comment.

// The currently focused cell.
stateManager.currentCell;

// The currently focused row.
stateManager.currentRow;

// In selecting row mode(stateManager.setSelectingMode(PlutoSelectingMode.Row)),
// Currently selected Rows. 
stateManager.currentSelectingRows;

// The position of the currently focused cell.
stateManager.currentCellPosition;

// In selecting square mode(stateManager.setSelectingMode(PlutoSelectingMode.Square)),
// The position of the currently selected cell.
stateManager.currentSelectingPosition;

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

i do it print(stateManager.currentCell); it error The getter 'currentCell' was called on null. dont have value to put in method
i cant call event.stateManager because It's different widget and how to change onselect to onSelecte i dont want to use onSubmit

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

call in onload
I/flutter (15624): null
I/flutter (15624): null
I/flutter (15624): []
I/flutter (15624): null
I/flutter (15624): null

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

look code and help me pls
https://github.com/fluk053/Test/blob/main/mainPage.dart
thank you

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

In onLoaded you assign the stateManager to a variable.

onLoaded: (PlutoOnLoadedEvent event) {
  stateManager = event.stateManager;
}

The currentCell, currentRow, etc. are used later in the onTap callback such as button.

  1. Assign stateManager to variable in onLoaded.
  2. The user selects the current cell in the grid or selects a row.
  3. Call stateManager.currentCell or currentRow in a callback such as a button to check the selected cell or row.

Calling stateManager.currentCell on onLoaded is null correct. As soon as the grid starts, there are no cells selected.

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

thank you now i can get position row and column.
but stateManager.currentSelectingPosition; dont to get all postion cell (row,column)to select. it sent last position to select .
how i can get Select to cover all cell ,and get list position to select?

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

In the next change, I will add a method to get the list of selected cells.

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

ok thamk you very much to help me.

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

Check out version 0.1.19.

example.
https://weblaze.dev/pluto_grid/build/web/index.html#feature/cell-selection

source code of example.
https://github.com/bosskmk/pluto_grid/blob/master/example/lib/screen/feature/cell_selection_screen.dart

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

thank for teach me now i can do.
thamk @bosskmk .

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

rows[element.rowIdx].cells[element.field].value = numData;
i use command this here value in screen dont change but i do to click again in widget value it change.
(The value does not change at all, you have to click the screen once.)

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024
// Change the value of one cell at a time.
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value');

// Changing multiple cell values at once. (Notify is true on the last change.)
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: true);

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024
// Change the value of one cell at a time.
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value');

// Changing multiple cell values at once. (Notify is true on the last change.)
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: false);
stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, 'new value', notify: true);

value not change

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

Is it a readonly column? If so, you must include the force: true option to change the value.

stateManager.changeCellValue(stateManager.rows[element.rowIdx].cells[element.field].key, '', force: true);

The force attribute is missing from the interface... If this doesn't work, please leave a comment.

from pluto_grid.

fluk053 avatar fluk053 commented on July 2, 2024

yes i set read only thank you tormorrow i go to do again now in home 23.00 pm. thank you

from pluto_grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.