Welcome Guest Search | Active Topics | Sign In | Register

Need Javascript Help with Grid Options
Menon
Posted: Friday, August 21, 2009 8:10:13 AM
Rank: Advanced Member
Groups: Member

Joined: 8/9/2007
Posts: 59
Hi There,

1. I am trying simple Validation in Grid of the TextBoxColumn for which i dont want the cursor to leave the cell if item is repeated.
That is if User enters incorrect value and click the next or another cell he should not be able to leave the cell.
I found Grid.editItem(itemIndex, save) method suitable for this purpose.
if give the itemIndex value and save=false.
As i have my validation in end_edit javascript function and i return null or newValue depends on Validation so save really doesnt matter i guess?
But i am not able to do that. I mean after Validation alert it goes to different cell inspite of this Javascript method Grid.editItem(itemIndex, save).

2. I am trying to use normal asp:TextBox inside customeColumn of the grid. My problem is that when i click on the cell the cursor doesnt come. I have to click twice to get the Cursor inside the TextBox.
I tired even textBox.focus() on begin_edit still i have no luck with it.

3. I would like to know in maskedit can we change the decimal (separator) "." to "," since we use "," in europe?


Thanks

Menon
eo_support
Posted: Tuesday, August 25, 2009 2:41:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will not be able to prevent user from leaving the cell, however you should be able to use Grid.editItem to put the user back to the previous cell after a time delay. The code will be something like this:

Code: JavaScript
if (validation_failed)
{
    //You must call editItem with a time delay at here
    setTimeout(function()
    {
        eo_GetObject("Grid1").editItem(itemIndex, false);
    }, 10);
}


For the focus issue you can try the same time delay trick again. The textbox is not visible yet when begin_edit is called. But if you delay your textBox.focus() call the focus should work for you.

I do not believe you can change the decimal operator for Number segment. However you are free to use multiple segments.

Hope this helps.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.