Author: jcrowley
Date: 2007-09-27 16:06:22 -0700 (Thu, 27 Sep 2007)
New Revision: 6654

Modified:
   openlaszlo/trunk/lps/components/lz/gridtext.lzx
Log:
Change 20070927-jcrowley-v by [EMAIL PROTECTED] on 2007-09-27 19:04:11 EDT
    in /Users/jcrowley/src/svn/openlaszlo/trunk-a
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: [repackaging to be checked into trunk; this was sent out from legals as
        20070814-jcrowley-S, and was approved by Ben] datagrid: If the columns 
are
        not updatable, it's impossible to select a row.

New Features:

Bugs Fixed: LPP-4201 - datagrid: If the columns are not updatable, it's 
impossible to
        select a row.

Technical Reviewer: bshine
QA Reviewer: max
Doc Reviewer: 

Documentation:

Release Notes:

Details: Ben and I weren't _entirely_ sure what this one meant, but I'm
        pretty sure I figured it out.  I made it so that one can
        select the text in a given row, without the row having to be
        editable.  All you have to do is specify selectable="true" on
        the gridtext element, as with any other text element.

Tests: Run the following example:

<canvas width="800" height="400" bgcolor="0xEAEAEA">
    <dataset name="contactsData" request="true" type="http" 
src="http:contactsdata.xml"/>
    <grid name="foo" datapath="contactsData:/*" sizetoheader="false" 
selectable="true">
        <gridtext editable="false" width="50" datapath="position()" 
sortable="false">
        No.
        </gridtext>
        <gridtext editable="false" selectable="true" 
datapath="@firstname">First</gridtext>
        <gridtext editable="false" selectable="true" 
datapath="@lastname">Last</gridtext>
        <gridtext editable="false" datapath="@displayname">Full Name</gridtext>
    </grid>
</canvas>

Note that you can now select the text in the row.



Modified: openlaszlo/trunk/lps/components/lz/gridtext.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/gridtext.lzx     2007-09-27 23:06:05 UTC 
(rev 6653)
+++ openlaszlo/trunk/lps/components/lz/gridtext.lzx     2007-09-27 23:06:22 UTC 
(rev 6654)
@@ -10,6 +10,10 @@
         <!--- type of content's alignment. Default: left
               possible values are: left, center, right     -->
         <attribute name="textalign" type="string" value="left"/>
+        <!--- Whether one is able to select the text.  (Only applies
+            if the grid isn't editable, because when it's editable,
+            the text is automatically selectable.) -->
+        <attribute name="selectable" type="boolean" value="false"/>
 
         <!--- @keywords private -->
         <attribute name="rowdp" value="" type="string"/>
@@ -71,6 +75,7 @@
 
                 <method event="oninit">
                 <![CDATA[
+                    this.setAttribute('selectable', classroot.selectable);
                     var f = function() {
                                 this.setAttribute("x", this._calcX());
                             }


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to