datagrid: send closefieldeditor

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

datagrid: send closefieldeditor

Post by JosepM » Wed May 23, 2012 10:03 pm

Hi,

I have a datagrid that when the user enter a code, on the closefieldeditor I query the database to retrieve the name and the price. This work fine.
Now I need a massive data enter, so I have a lot of codes and I want add manually to the datagrid and call the closefieldeditor for each line that I add.

My question is: How can I send "closefieldeditor" to the cell? Make sense?

A read the documentation and forums but I don't find any solution.

Salut,
Josep M

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10335
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid: send closefieldeditor

Post by dunbarx » Thu May 24, 2012 12:10 am

Hi.

Can't you trap, say, "mouseUp", get the target, and send "closeFieldEditor"?

A dataGrid sends just about eight million messages when you even go near it, but it does send the regular ones as well.

Craig Newman

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: datagrid: send closefieldeditor

Post by phaworth » Thu May 24, 2012 2:05 am

Hi Josep,
I'm not quite sure what you want to do but it sounds like you have a one time task to load a lot of data into the datagrid - is that right?

You could use 1 SELECT statement to get all the codes, their names and prices you want to load into the datagrid, then set the dgText of the datagrid to what comes back from the SELECT, no need to use the closeFieldEditor handler.

Sorry if I'm misunderstanding what you need, if so let me know and I'll try to come up with a different solution.

Pete

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: datagrid: send closefieldeditor

Post by JosepM » Thu May 24, 2012 8:01 am

Hi,

Thanks for the answers.

Yes. I have a massive code bar data entry, where only I get the codes for. My first idea was call the closefieldeditor but I don't found the way to do that so for each code I add by script a row, so I can't trap the "mouseup" nor the target.

The solution was, as Pete say, perform the queries and prepare an array and dispatch "AddData" to the datagrid with the array.
Now I need improve the speed of addData so is a little slow. Now I add row by row, and I will try to create an array with all the rows and pass to the datagrid.

Salut,
Josep M

Post Reply