Welcome Guest Search | Active Topics | Sign In | Register

Returning false in custum_begin_edit and sizing issues Options
patingamon
Posted: Wednesday, December 12, 2007 5:50:37 AM
Rank: Member
Groups: Member

Joined: 9/6/2007
Posts: 29
According to the user guide for

grid_customcolumn_beginedit Event Handler


Return Value
false if you wish to cancel entering edit mode. To continue entering edit mode, do not return any value.



I modified the sample app's Custom Column demo.ascx to contain the following:
Code: HTML/ASPX
<eo:CustomColumn Width="200" HeaderText="Question"
    ClientSideEndEdit="on_question_end_edit" 
    ClientSideGetText="on_question_column_gettext"
    ClientSideBeginEdit="on_question_begin_edit" 		
    >
    <EditorTemplate>
        <input type="text" id="question_TextBox" />
    </EditorTemplate>
</eo:CustomColumn>


and added the following JavaScript to the file:

Code: JavaScript
function on_question_column_gettext(column, item, cellValue)
{
    return cellValue;
}

function on_question_begin_edit(cell)
{
    //Get the current cell value
    var v = cell.getValue();
    
    // keep Q2 readonly
    if (v.substr(0, 3)== 'Q2.')
    {
        return false;
    }
    
    
    //Load the value into our text box
    var textBox = document.getElementById("question_TextBox");
    textBox.value = v;
}

function on_question_end_edit(cell)
{
    //Get the new value from the text box
    var textBox = document.getElementById("question_TextBox");
    var v = textBox.value;
    
    
    //Return the new value to the grid    
    return v;
}


Two problems have occurred:

1) When I click on Q2, it returns false. That's good. When I click off Q2, the value of that cell becomes 'null'. Therein lies the problem

2) The textbox's size does not correspond at all to the cell width. It appears that I cannot get the cell width, otherwise I would manually set it in the begin_edit routine. I can manually set it in the template, but it seems odd, as the existing code doesn't have to set the select's width.

Thoughts?
eo_support
Posted: Wednesday, December 12, 2007 6:05:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Thanks for the information! We will look into it and get back to you as soon as possible.


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.