??? Spinbox w/reset in AdminPC

[xFv]

Previously Cylent1
#1
Does anybody know how to get the "reset" button working with spinbox through admin template?
I can get it working with this:
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:spinboxunit name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" label="{$property.title}" min="1" max="1000" step="1" />
<xen:include template="style_property_unit_extra" />
But that isn't right as you can see here:
Capture2.PNG

If I try and save it with this:
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:spinboxunit name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" label="{$property.title}" min="1" max="1000" step="1" />
<xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>
It Errors and doesn't save.
Any Help is much Appreciated!
 

Mike

XenForo developer
Staff member
#3
I'm not sure why your second bit of code has added <xen:html> tags around the include. You wouldn't need that based on what I'm gathering from the rest of the context.
 

[xFv]

Previously Cylent1
#4
I'm not sure why your second bit of code has added <xen:html> tags around the include. You wouldn't need that based on what I'm gathering from the rest of the context.
Your right! But as you can see in the image above,the edit icon doesnt line up right. That code was taken from a admin template that had radio buttons. I am needing a spinbox and Without the below code, I do not get the edit icon in adminpc which I am trying to achieve. Any Ideas?
Code:
<xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>
***EDIT***
I have figured it out with using a different admin template example. Thanx...
 
Last edited:

[xFv]

Previously Cylent1
#5
OK... New Issue.
How would I remove the Checkbox from this code while preserving the edit icon? I do not need it.
Code:
<input type="hidden" name="checkboxes[]" value="{$property.property_definition_id}" />
<xen:checkboxunit label="">  
    <xen:option name="_null_" selected="{$property.propertyValueScalar}"
        label="{$property.title}"
        title="{xen:if $debugMode, $property.property_name}">
        <xen:spinbox name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}"
            min="0" step="0.25" />
    </xen:option>
    <xen:explain>{$property.description}</xen:explain>
    <xen:html><xen:include template="style_property_unit_extra"><xen:set var="$reset">{xen:phrase reset}</xen:set></xen:include></xen:html>
</xen:checkboxunit>
 
Last edited:

Mike

XenForo developer
Staff member
#6
You can't, at least if you're including the style_property_unit_extra template. That detects what actions are appropriate for a given property.
 

[xFv]

Previously Cylent1
#8
This does it
Code:
<xen:spinboxunit label="{$property.title}" name="properties[{$property.property_definition_id}]" value="{$property.propertyValueScalar}" min="1" max="1000" step="1">
    <xen:explain>{$property.description}</xen:explain>
    <xen:hint>{xen:if $debugMode, $property.property_name}</xen:hint>

    <xen:html>
        <xen:include template="style_property_unit_extra">
            <xen:set var="$reset">{xen:phrase reset}</xen:set>
        </xen:include>
    </xen:html>

</xen:spinboxunit>
 

Mike

XenForo developer
Staff member
#9
Sorry, I misunderstood the checkbox you were referring to -- I thought you were talking about the reset checkbox (which comes along with the edit icon).
 

[xFv]

Previously Cylent1
#10
Sorry, I misunderstood the checkbox you were referring to -- I thought you were talking about the reset checkbox (which comes along with the edit icon).
LOL! I should have been more specific in the details. But the above code is exactly what I needed.
 
Top