Datagrid question

Peter Haworth pete at lcsql.com
Thu Apr 16 13:53:52 EDT 2015


setDataOfIndex doesn't redraw the datagrid. Add a call to RefreshIndex
after your setDataOfIndex.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Thu, Apr 16, 2015 at 10:23 AM, William Prothero <prothero at earthednet.org>
wrote:

> I’m missing something. I have the script, in the datagrid group script:
>
> local savedRowIndex, savedColumnIndex
>
> —this works as expected
> on mouseDown
>    put  the dgHilitedIndexes of me into savedRowIndex
>    put the dgColumn of the target into savedColumnIndex
>   put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
> target) into fld "editValue"
> end mouseDown
>
> —This handler doesn’t seem to update the data grid, because when I click
> the cell again, the changes aren’t there.
> on saveLastEditedCell
>    if savedRowIndex="" or savedColumnIndex="" then
>       exit saveLastEditedCell
>    end if
>    put fld "editValue" into myData
>    setDataOfIndex(savedColumnIndex, savedRowIndex, myData)
> end saveLastEditedCell
>
> This gets the data and puts it into the field. I then make changes and in
> a button, dispatch “saveLastEditedCell” to the dg group script. But, it
> doesn’t update the cell data. There are no errors thrown, but obviously, I
> am missing something.
>
> Bill
>
>
> > On Apr 16, 2015, at 8:48 AM, Peter Haworth <pete at lcsql.com> wrote:
> >
> > You need to dispatch or send the setDataOfIndex to the datagrid.
> >
> > Pete
> > lcSQL Software
> > On Apr 15, 2015 9:59 PM, "William Prothero" <prothero at earthednet.org>
> wrote:
> >
> >> Thanks! Worked like a charm. Now I suppose, to get it back in the data
> >> grid cell, it’s:
> >>
> >> local savedColumnINdex,savedRowIndex   —saved from command that loaded
> the
> >> data from the cell into the field.
> >>
> >> on mouseUp
> >>    put fld “editedCellContents” into myEditedData
> >>    setDataOfIndex(savedRowIndex, savedColumnINdex, myEditedData)
> >> end mouseUp
> >>
> >> Whoops! Not quite. The button doesn’t find the handler. I’ll have to
> >> fiddle with it more tomorrow. It’s late here.
> >> Thanks,
> >> Bill
> >>
> >>> On Apr 15, 2015, at 5:33 PM, dunbarx at aol.com wrote:
> >>>
> >>> on mouseDown
> >>>  put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
> >> target) into vld "yourField"
> >>> end mouseDown
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list