datagrid: force to send "on closeeditor" to one column

zryip theSlug zryip.theslug at gmail.com
Tue Mar 8 18:18:53 EST 2011


On Tue, Mar 8, 2011 at 11:51 PM, JosepM <jmyepes at mac.com> wrote:
> Hi,
>
> I have a validation for each column.

Ok, so I assume you have defined a custom column behavior.
Your closeFieldEditor should be something like this:

on closeFieldEditor pFieldEditor
   local tValue

  put the text of pFieldEditor into tValue

  switch the dgColumn of me

    case myFirstCol
       checkValue tValue
       break

    case mySecondCol
       checkValue tValue
       break

     etc
  end switch
end closeFieldEditor

Why not have a handler somewhere in the datagrid group:

command checkAllValue pColumn, pValue
    switch pColumn

    case myFirstCol
       checkValue pValue
       break

    case mySecondCol
       checkValue pValue
       break

     etc
  end switch
end checkAllValue

You could call this handler in the closeFieldEditor handler

on closeFieldEditor pFieldEditor
  local tValue

  put the text of pFieldEditor into tValue

  checkAllValue the dgColumn of me, tValue
end closeFieldEditor

And also in the dragDrop handler for each column of the datagrid.


Best,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc




More information about the Use-livecode mailing list