I'm using various custom properties in conjunction with some formatting code to handle the translation of various data types between the screen and my sqlite database. For example, a custom property named isDate with a value of true defines that a field is a date and I Have code that formats the date correctly when retrieveing it form the database for display on a card and also when storing it back in the database from a card.
I would like to use these same routines in FillInData but I don't want to go in and create a custom behaviour for every column in every datagrid where its required. I guess I'm looking for a way to change the default code in FillInData to call my formatting routines so that every column in every datagrid will have the formatting code in there.
Is that possible?
Thanks,
Pete
Changing the defauly behaviour of FillInData
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Changing the defauly behaviour of FillInData
Yes, you can override the default behavior for rendering data to a cell.
How Do I Override the Default Behavior For Rendering Data to a Cell?
How Do I Override the Default Behavior For Rendering Data to a Cell?
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Changing the defauly behaviour of FillInData
Thanks Trevor. I had read that lesson but it doesnt feel like I can quite do what I would like ideally. The example you gave seems like I would have to do that for every datagrid with a column I want to customise. What I was hoping was that I could somehow set the script of the "Default Column" button for every datagrid I create to include the code I need without having to change the dgProps to point to a different button. It's a subtle difference, hope I'm explaining it correctly.
Thanks,
Pete
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: Changing the defauly behaviour of FillInData
You would need to edit the template button of the revDataGridLibrary stack and then save the stack. You will need to do this each time you download an update to the Rev IDE and you will need to rebuild any standalones you may have already created.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Changing the defauly behaviour of FillInData
Thanks Trevor. That sounds like asking for trouble to me so I think I'll go with the method outlined in the lesson.
Pete
Pete