pluto_grid icon indicating copy to clipboard operation
pluto_grid copied to clipboard

working in RTL languages like Hebrew and Arabic

Open devahmedghanim opened this issue 4 years ago • 7 comments

how can i configure RTL ?

devahmedghanim avatar Aug 09 '21 09:08 devahmedghanim

This was my code:

Directionality( textDirection: TextDirection.rtl, child: PlutoGrid(...

And the strings are in Hebrew

ylahav avatar Aug 09 '21 15:08 ylahav

when i wrap with Directionality => resize of the column not working (will be reverse ) and if you move by keyboard inside the raw it will be reverse also the header of column and header of filter option have issues

fff

ff2

its a column

PlutoColumn(
        enableContextMenu: true,
        renderer: (c) {
          return Align(
            alignment: Alignment.center,
            child: Text(
              c.cell.value.toString(),
            ),
          );
        },
        hide: false,
        enableHideColumnMenuItem: false,
        enableRowChecked: false,
        enableColumnDrag: false,
        enableDropToResize: false,
        enableEditingMode: false,
        enableRowDrag: false,
        enableSorting: false,title: '#', field: 'text_index', type: PlutoColumnType.text(),
        textAlign: PlutoColumnTextAlign.left),


and its Scaffold Widget

@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        alignment: Alignment.center,
        padding: const EdgeInsets.all(30),
        child: Directionality(
          textDirection: TextDirection.rtl,
          child: PlutoGrid(
            columns: columns,
            rows: _dataSource.map<PlutoRow>((e) => buildPlutoRow(e)).toList(),
            configuration:  PlutoGridConfiguration(
              /// If columnFilterConfig is no set, the default setting is applied.
              ///
              /// Return the value returned by resolveDefaultColumnFilter through the resolver function.
              /// Prevents errors returning filters that are not in the filters list.
              columnFilterConfig: PlutoGridColumnFilterConfig(
                filters: const [
                  ...FilterHelper.defaultFilters,
                  // custom filter
                  ClassYouImplemented(),
                ],

                resolveDefaultColumnFilter: (column, resolver) {
                  if (column.field == 'text') {
                    return resolver<PlutoFilterTypeContains>() as PlutoFilterType;
                  } else if (column.field == 'number') {
                    return resolver<PlutoFilterTypeGreaterThan>()
                    as PlutoFilterType;
                  } else if (column.field == 'date') {
                    return resolver<PlutoFilterTypeLessThan>() as PlutoFilterType;
                  } else if (column.field == 'select') {
                    return resolver<ClassYouImplemented>() as PlutoFilterType;
                  }

                  return resolver<PlutoFilterTypeContains>() as PlutoFilterType;
                },
              ),
              iconSize: 30,
              iconColor: Colors.blueGrey,
              enableColumnBorder: true,
              rowHeight: 30,
            ),
            createFooter: (stateManager) {
              stateManager.setPageSize(30, notify: false); // default 40
              return PlutoPagination(stateManager);
            },
            mode: PlutoGridMode.select,
            onRowChecked: handleOnRowChecked,
            onChanged: (PlutoGridOnChangedEvent event) {
              print(event);
            },
            onLoaded: (PlutoGridOnLoadedEvent event) {
              columns.map((e) => event.stateManager.autoFitColumn(context, e));
              event.stateManager.setShowColumnFilter(true);
              event.stateManager.setSelectingMode(PlutoGridSelectingMode.horizontal);
                // event.stateManager.cellPositionToMove(PlutoGridCellPosition(), PlutoMoveDirection.left);
              //event.stateManager.showSetColumnsPopup(context);
              stateManager = event.stateManager;
            },

          ),
        ),
      ),
    );
  }

devahmedghanim avatar Aug 09 '21 15:08 devahmedghanim

I agree - this is not enough - a support for RTL languages is need with something like this in the configuration:

gridDirection: PlutoGridDirection.rtl

ylahav avatar Aug 10 '21 04:08 ylahav

@ylahav @devahmedghanim

I'm sharing a link to the RTL feature so you can preview it. Please check the link to see if there are any problems. If there are no problems, I will distribute it.

https://weblaze.dev/pluto_grid/build/pre/web/#feature/rtl

bosskmk avatar May 19 '22 13:05 bosskmk

menu of grid must be from right to left also . if you move by keyboard inside the raw it will be reverse . when you select set column the design of popup not good must be expanded to be better . design of date picker It is very old, I think it is from the days of the Romans . and if you can make filter to date .. > range from date to date . its also so important if you can make function to rebuild grid . (refresh) its also so important if you can make function to rebuild row only. (refresh) in sync fusion if you change any thing in data source the grid change in same time without any rebuild i think they make a grid directly from the list of data source

devahmedghanim avatar May 22 '22 12:05 devahmedghanim

@bosskmk can't we have this feature yet?

  • is there a way to make the column width responsive (full inside the whole grid)

hamzaj9 avatar Jun 29 '22 15:06 hamzaj9

@hamzaj9

I am preparing to add column width adjustment to fit the entire grid width in version 4.1.

bosskmk avatar Jun 30 '22 06:06 bosskmk

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Nov 16 '22 11:11 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 01 '22 11:12 github-actions[bot]