Editable fields in templates

(6 posts) (2 voices)
  1. ajdjackson, Member

    Hi

    I've created a report displayed using a template.

    I would like to be able to in-place edit some of the fields. I can't seem to get this to work with the template. It works without the template. Is this possible?

    Here's the report code:

    select 'dbr.template', '#SS_Customer'; select 'dbr.colstyle','UnitThumb','image'; select 'dbr.title','';

    select 'dbr.report','sp_DBR_Large_Unit_Image','[UnitThumb]','popup','inImage_ID=ImgID';

    select 'dbr.editable', 'CustForeName', 'sp_DBR_SS_Edit_Cust_Forename', 'inPL_ID=inPlot','inCustForename=CustForeName';

    select concat(t.dc_HouseNumber," ",t.dc_AddressLine1,", ",t.dc_Town," ",t.dc_Postcode) as '[Address]', w.image_thumb as '[UnitThumb]', t.dc_HouseTypeName as '[HouseName]', t.dc_HouseType as '[HouseType]', t.dc_SquareFootage as '[HouseSize]', t.dc_NumberOfBedrooms as '[HouseBeds]', x.tblSS_Cust_Forename as 'CustForeName[CustForeName]', x.tblSS_Cust_Surname as '[CustSurName]', x.tblSS_Cust_HouseNo as '[CustHouseNo]', x.tblSS_Cust_Address as '[CustAddress]', x.tblSS_Cust_Town as '[CustTown]', x.tblSS_Cust_Postcode as '[CustPostcode]', x.tblSS_Cust_Tel as '[CustTel]', x.tblSS_Cust_Mob as '[CustMob]', x.tblSS_Cust_Email as '[CustEmail]', w.image_id as '[ImgID]', inPlotID as 'inPlot[inPlot]' from hilmark.devc_import t join hilmark.devc_xref u on t.dc_PropertyID = u.PropertyID join hilmark.tblsitesplotsjake v on u.MIS_ID = v.tblContractXIDJobNo join hilmark.images w on v.SS_Img_Unit_ID = w.image_id join hilmark.tblss_customer x on u.MIS_ID = x.tblSS_Cust_Plot where u.MIS_ID = inPlotID ;

    and here is a section of the template:

    <div class="imagecon">

    <div class="titlecon"> <div class="logo">< img src="user/images/WEB_Hilmark_Logo_Trans.png" alt="Hilmark Home" /></div> <div class="title">Customer/Unit Details</div> </div>

    <div class="plot"> <div class="image">#UnitThumb</div> <div class="plotdetails"> <div class="subtitle">Unit Details</div> <div class="subtitle1">Unit Address</div> <div class="subtitle1">House Name</div> <div class="name">#Address</div> <div class="name">#HouseName</div> <div class="divclear"></div> <div class="subtitle2">House Type</div> <div class="subtitle2">House Size</div> <div class="subtitle2">No. of Beds</div> <div class="name1">#HouseType</div> <div class="name1">#HouseSize</div> <div class="name1">#HouseBeds</div> </div> </div>

    <div class="plot"> <div class="custdetails"> <div class="subtitle">Customer Details</div> <div class="subtitle1">Customer Forenames</div> <div class="subtitle1">Customer Surname</div> <div class="name">#CustForeName</div> <div class="name">#CustSurName</div> <div class="divclear"></div> <div class="subtitle3">House Number</div> <div class="subtitle3">Address</div> <div class="subtitle3">Town</div> <div class="subtitle3">Postcode</div> <div class="name2">#CustHouseNo</div> <div class="name2">#CustAddress</div> <div class="name2">#CustTown</div> <div class="name2">#CustPostcode</div> <div class="divclear"></div> <div class="subtitle2">Telephone #</div> <div class="subtitle2">Mobile #</div> <div class="subtitle2">Email Address</div> <div class="name1">#CustTel</div> <div class="name1">#CustMob</div> <div class="name1">#CustEmail</div> </div> </div>

    </div>

    The report linking works great in the template but not the editing.

    Cheers

    Jake

  2. myDBR Team, Key Master

    Jake,
    In order to use editable fields in template, you need to use dbr.record. See discussion and examples here.

    --
    myDBR Team

  3. ajdjackson, Member

    Hi

    Thanks for getting back.

    I realised that I had to use dbr.record but I don't know how.

    When I wrap the above query with a dbr.record start and end I just get a blank page.

    What I would like to do is to be able to edit several (6) of the fields. How do you address the fields individually when you record a result or do I have create several individual queries, each wrapped with a dbr.record statement? If so does that mean I need several templates?

    How do I amend the above to get it to work?

    As you can see I'm at a loss or how to do this and there's nothing similar in Demo.

    Any help would be most appreciated.

    Cheers

    Jake

  4. myDBR Team, Key Master

    When you use dbr.record with templates, you create a template variable from the result set and use it in the template. Take a look at the documentation how to record and use template variables.

    If you have multiple editable fields you wish to wrap into DIV as in your example, use dbr.divify to use DIV's instead of normal HTML table result set.

    --
    myDBR Team

  5. ajdjackson, Member

    Thanks for the pointer!

    I never fully appreciated the power of dbr.divify.

    The only issue I've left (at the moment) is that whenI click into the field to edit the appearance defaults to the mydbr look - if you follow me.

    I have the 'editable' divs set to have font-size:110%, font-weight:bold; and background-color:white;

    I have tried using 'options={'jeditable_options'}' but the combinations I've tried either results in no change or the field becoming un-editable:

    some of the combinations tried:

    select 'dbr.editable', 'CustForeName', 'sp_DBR_SS_Edit_Cust_Forename', 'inPL_ID=inPlot','inCustForename=CustForeName',"options = {'cssclass:name'}";

    "options = {'font-size:110%','font-weight:bold','background-color:white'}";

    Cheers and a happy St. Patricks Day

    Jake

  6. myDBR Team, Key Master

    Use format:

    "options={'cssclass':'formclass'}"

    and the formclass is the class of the input form. So to use that for the input field, you use:

    select 'dbr.css', '.formclass input  {font-size:110%;font-weight:bold;background-color:white}';

    --
    myDBR Team


Reply

You must log in to post.