PDA

View Full Version : Adding padlock function to top right of a sheet



joeblack1863
March 29th, 2018, 14:11
Hi,

Been looking at this to add it to the calendar log sheet which I have been changing, so I can make the fields all readonly.

I see how it works (including the lua script), but for the life of me I can't identify the xml code that displays in on the sheet.

I have looked at the record_item.xml but I am not seeing it (unless somehow it is the "name" field).

Anyone help (if what I have said makes sense)


Regards


JB

joeblack1863
March 29th, 2018, 16:53
Think I may have found it, just need to work out how to implement it

<template name="button_record_locked"> in template_campaign.xml

damned
March 29th, 2018, 23:25
Hey joeblack1863 only the GM can make changes to the Calendar... Im not sure the padlock adds any value.

joeblack1863
March 30th, 2018, 10:35
Hi damned, I made a small extension to the Log Entry page, adding some fields. I prefer the look of a page when the fields are readonly.

Added bonus, I hopefully get to learn how another part of how the system works! You never know, if I keep this up, I might actually write something useful... :)

JB

joeblack1863
March 31st, 2018, 20:10
Damned,

Got it working, learnt a lot about the scope of objects and how to move up and down the tiers (there is some good stuff on it on this forum). Thanks to Trenloe for the bit about the use of debug to understand where the objects are in the tier).

Also learnt how to persist stuff, I was scratching my head as to why the readonly was working but not saving. Thanks Damned, your comment about working with the database, not just the interface, in one of the threads switched the lights on :-)

I have attached two screenshots of readonly and editable, with the extra fields, if you are interested to take a look.

It was a worthwhile exercise, just for the amount I learnt (an I will probably use this extension as well.


JB

damned
April 1st, 2018, 00:55
Well done joeblack1863

Do wrap it up as an extension - its always good to have more code examples out there - and other people may like to use it too :)

joeblack1863
April 3rd, 2018, 19:21
Thanks Damned,

That's been done, hope it is of some use.

JB