community icon indicating copy to clipboard operation
community copied to clipboard

Simple PoS Data Handling Example

Open r4d10n opened this issue 4 years ago • 3 comments

Improved example based on basic_data.py, suited for PoS GUI....

Maintainer merge checklist

  • [x] Title is descriptive/clear for inclusion in release notes.
  • [ ] Applied a Component: xxx label.
  • [ ] Applied the api-deprecation or api-break label.
  • [ ] Applied the release-highlight label to be highlighted in release notes.
  • [ ] Added to the milestone version it was merged into.
  • [ ] Unittests are included in PR.
  • [ ] Properly documented, including versionadded, versionchanged as needed.

r4d10n avatar Jun 13 '21 14:06 r4d10n

Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines.

welcome[bot] avatar Jun 13 '21 14:06 welcome[bot]

Not bad! but a couple feedback, in no particular order

  • don't leave trailing spaces at the end of lines
  • you probably want to make the TextInputs multiline: False
  • size_hint on the popup buttons is not useful and breaks their apparence
  • making the delete button use on_release instead of on_press avoids the bug of another button briefly showing as selected
  • the sort logic is weird, to avoid it i would instead keep the items in a list in no particular order (or order of addition, so orderno of the last one is always the biggest one), and use sorted(items, key=app.sort_order) on the recycleview, so it's a matter of presentation rather than app logic, to avoid the weird multiple calls to self.sort in places.
  • you probably want to disable auto_dismiss for the popup, as it's a small one and easy to leave by mistake
  • a filter text input at the top could be nice, and thanks to separating the actual items from what is passed to the recycleview, it would be a matter of filtering at the same level as sorting, data: sorted(item for app.items if search.text in item['customer.text']) or something like it.
  • select could add the id of the order to a list of selected items, and an item being selected could change its appearance (color or border or what else).

Anyway, it's nice already, you don't necessarily need to do all of that, although i'd prefer the extra spaces to be removed, and the small glitches (button's size_hint, on_press…) to be resolved at least.

tshirtman avatar Jun 14 '21 23:06 tshirtman

Hi Gabriel... Much thanks for the detailed review and suggestions... I've given a shot at trying those stuff you suggested... Kindly test and let me know. It's a learning effort !

Some issues I noticed:

  • Alternate Row coloring works only for sorting by OrderID. On sorting using other params, order of coloring changes and I am unable to modify widget parameters (bkcolor) for dynamic classes (Row). Any suggestions for modifying dynamic class params ?

  • Filtering works almost okay with on_text_validate. For dynamic updating, on_text method does not seem to get invoked on all text changes esp backspace. Even now, some issues while trying to delete items during Filtered view. Is there something wrong with my approach ?

  • Tried Togglebutton / CheckBox instead of Button for Selecting rows. On clicking it, several other rows seems to get selected too. Also background_color property is not being applied on them. Select button fails to work on some random rows. Some presses shows blue colour elsewhere.

  • Ideally Column Headers with click sorting would be nice and aligned. May be a Spreadsheet widget :) ?

r4d10n avatar Jun 15 '21 14:06 r4d10n