datepicker altField

102 views
Skip to first unread message

MaxDoesPython

unread,
May 10, 2010, 1:16:11 AM5/10/10
to SlickGrid
Can you point me to an example of using datepicker with altField. I
want to have a column that is a date input, and next to it a column
that is not editable showing the Day of week for date in date column.

thanks,


max

Michael Leibman

unread,
May 10, 2010, 4:35:58 PM5/10/10
to slic...@googlegroups.com
What do you mean by an altField?
What you are describing is a setup where one column value depends on another.  You can hook into onCellChanged event or configure your own setValueHandler for the date column, and update the datasource in there.  After doing that, just call an updateRow() on the affected row.

Max Slimmer

unread,
May 10, 2010, 5:45:43 PM5/10/10
to slic...@googlegroups.com
Thanks for the response, I can probably do as you suggest. The
js-ui-datepicker used in DateCellEditor has an option to populate an
alternate field with the selected/set date and to specify the format
of that data, I was hoping to use that to populate a column with the
day for the week corresponding to the date in adjacent column, and
avoid trying to figure out what the dow is. I will try to capture
this data or find a way to call datepicker to compute it after the
fact.

max

Max Slimmer

unread,
May 10, 2010, 6:14:26 PM5/10/10
to slic...@googlegroups.com
A couple of notes, for now off list. I really like slickgrid, I
haven't found anything comparable. I am new at javascript, have been
doing middleware python for many years.
I am trying to add a selectlist editor control and have it working
pretty well but have encountered a problem I can't seem to solve. I
have tried adding various things to slick.grid handleKeyDown() to
prevent the left / right arrow keys being propagated on to the select
control. The select list is created after entering this function and
processing gotoDir... and you have codded it such that it should not
allow the event to bubble up... however after the control is created
it receives the arrow event and moves in the options list displaying
the next/previous entry to the selected value. If I enter the cell via
Tab or shift-Tab all is OK.

If you have any ideas or could suggest a different list to post the
problem to that would be great.

When I get it working I would be happy to post the code for others to use.

I also found what appears to be a bug in how you handle onAddNewRow.
I tried to use the code as in; example and it sort of worked but had a
couple problems.The first is where it is called, you were calling it
in commitCurrentEdit() and then only if there had been a change in the
previous cell. I was populating one of the columns in the new row with
a default value, and the code didn't get hit until the second col in
the new row was entered. by moving this code to gotoDir() and not
doing the delete of last row from grid data it works for me. I guess
if one were to get to the new row via mouse click it would fail, I
will work on that part. The other thing is that the api / hook you
provided was passing value which was the value of which ever was the
current cell when entering the new row, this doesn't seem to have any
use as it is possible to down arrow or enter Return from last cell in
last row etc. so if one wants data from some specific cell it is
accessible in the grid and then you know what you are getting. At any
rate I will send you my changes and if you wish you can make them
available. Or let me know what I should do to make them available.

thanks again for a great piece of software,

max



On Mon, May 10, 2010 at 1:35 PM, Michael Leibman
<michael...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages