Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6AA410A44 for ; Mon, 15 Jul 2013 18:26:46 +0000 (UTC) Received: (qmail 10922 invoked by uid 500); 15 Jul 2013 18:26:46 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 10894 invoked by uid 500); 15 Jul 2013 18:26:46 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 10886 invoked by uid 99); 15 Jul 2013 18:26:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 18:26:45 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of omuppi1@gmail.com designates 209.85.128.175 as permitted sender) Received: from [209.85.128.175] (HELO mail-ve0-f175.google.com) (209.85.128.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 18:26:39 +0000 Received: by mail-ve0-f175.google.com with SMTP id da11so9967947veb.6 for ; Mon, 15 Jul 2013 11:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=yZjv7Dv+ZR+TIDy1vK3znD+5ZdtDg7NNeYtIboZEyHU=; b=C63pvbcJ1ZF/gxoqMyRuWQo4R/p9OCIYAE1quXFsozmRQJoDrYZWwpCuQWVj2uzZ2m PoUm/yyikJSlZEpFhlcQg+sOBtGeCCDS4Z1D2kCBsJrqUbl3YJJUUhfwjvWSJSiG1O5o zm4emYO7i7EFgsQw/3OUSc8520j9e+fztURjKmkOxqKfkklionkkGpFt7TTt/NGw4AtT uAzdDqN1QcLmhG8rlzks2iIBiqCvc6q+GjqVuIdjOarmPf74MDFgzOrjKti2a21qLf+J +mTSOuR68dC/Dp2F/m2uTy10cGwIB/vdWLGrk1PCN73AGCNpjEx50RHIouS1+lO5TRR2 fHzw== X-Received: by 10.220.58.195 with SMTP id i3mr29089326vch.38.1373912778079; Mon, 15 Jul 2013 11:26:18 -0700 (PDT) MIME-Version: 1.0 Sender: omuppi1@gmail.com Received: by 10.58.251.7 with HTTP; Mon, 15 Jul 2013 11:25:47 -0700 (PDT) In-Reply-To: References: <3019CA59-6588-4BF6-B8B6-31A0910B35D4@tanium.com> From: OmPrakash Muppirala Date: Mon, 15 Jul 2013 11:25:47 -0700 X-Google-Sender-Auth: Q0uYZaMQFR7ZJZzbtAbzTj2eWv8 Message-ID: Subject: Re: Activate a cell for editing To: users@flex.apache.org Content-Type: multipart/alternative; boundary=001a11c2c8a417038204e190ff50 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2c8a417038204e190ff50 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jul 15, 2013 at 11:17 AM, Jesse Ward-Karet wrote: > I haven't done much with Spark data grid. In a Spark list, you just create > a custom item renderer and set 'autoDrawBackground' to false. If you want > to handle any of the various selection states you can add them to your > ItemRenderer. > > I actually don't do it that way anymore myself. I found I wanted more > separation between item renderer and look/feel, so I created a class: > > public calls SkinnableItemRenderer extends SkinnableComponent implements > IItemRenderer, IDataRenderer > > This allows me to create standard spark skins for my item renderer classes. > > It is basically a copy of spark.components.supportClasses.ItemRenderer > with support for autodrawbackground removed. In replacement, it > instantiates an InteractionStateDetector on creation and whenever the > interaction state changes it calls invalidateRendererSkin(). In > invalidateRendererSkin(), make sure to invalidateSkinState(), and in > getCurrentSkinState(), you can use the state detector to check for the OVER > state. My getCurrentSkinState() supports all the 'built in' states, i.e. > dragging, selectedAndShowsCaret, hoveredAndShowsCaret... etc. > > I have another class, SkinnabledEditableItemRenderer that extends the > available states to include editing states. > > Hope that helps. > > This is a pretty good approach as well. Except for Spark DataGrid, you will want extend the GridItemRenderer component. This component gives you access to the Grid related properties. > > On Jul 15, 2013, at 10:33 AM, OmPrakash Muppirala > wrote: > > > One way to do it is to attach a selectionChanging event handler to the > > Spark Datagrid. In that handler, simply call event.preventDefault() > > > > Please keep in mind that there may be other side effects to doing this, > so > > consult the documentation [1] before trying this :-) > > > > Thanks, > > Om > > > > [1] > > > http://flex.apache.org/asdoc/spark/components/DataGrid.html#event:selectionChanging > > > > On Mon, Jul 15, 2013 at 10:01 AM, mark goldin > wrote: > > > >> How do I do "disable auto drawing of the selected/hover states"? > >> > >> > >> On Mon, Jul 15, 2013 at 11:41 AM, Jesse Ward-Karet > wrote: > >> > >>> Why not allow selection but just disable auto drawing of the > >>> selected/hover states? Then use an editable item renderer. > >>> > >>> On Jul 15, 2013, at 8:23 AM, mark goldin > wrote: > >>> > >>>> I am working on data editing in Spark dataGrid. Trying to come up with > >> a > >>>> solution where I can use selectionMode="none" but still be able to > >>> activate > >>>> editing in a cell. > >>>> > >>>> Thanks > >>> > >> > > --001a11c2c8a417038204e190ff50--