Welcome Guest Search | Active Topics | Sign In | Register

Turn on Save on Grid Edit Options
Bill Murray
Posted: Tuesday, November 9, 2010 9:46:03 PM

Rank: Newbie
Groups: Member

Joined: 11/6/2010
Posts: 7
I think I don't understand...

I am using the example to edit a grid like Excel and this part I get...
.. In the <eo:TextBoxColumn ClientSideBeginEdit="on_cellEdit" ...>

and my javascript looks like this:
<script type="text/javascript">
function on_cellEdit() {
...
In here I want to turn on the ToolBar1.items[0].visible = true
#1 - how do I do that?
#2 - how can I make the Toolbar1 be the "Post" button (i.e. javascript onsubmit=post)
(the example uses an <asp:button> - I would prefer to use the toolbar, etc.
}
</scrript>

Can anyone help?


I would prefer to do this all server side - but if that's not possible ... then client side could work out too!
eo_support
Posted: Wednesday, November 10, 2010 8:37:36 AM
Rank: Administration
Groups: Administration

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

To show/hide a toolbar item on the client side, you would need to call this function:

http://doc.essentialobjects.com/library/1/jsdoc.public.toolbaritem.setvisible.aspx

If you have not used our client side API before, you will want to go over this topic first:

http://doc.essentialobjects.com/library/1/clientapi_howto.aspx

You can set this property to true for the toolbar to post back on click:

http://doc.essentialobjects.com/library/1/eo.web.toolbar.autopostback.aspx

Hope this helps. Please feel free to let us know if you have any more question.

Thanks!
Bill Murray
Posted: Wednesday, November 10, 2010 10:54:23 AM

Rank: Newbie
Groups: Member

Joined: 11/6/2010
Posts: 7
Here is what I did - and I think it worked!
<eo:ToolBar id="ToolBar1" AutoPostBack="True" ...

When the page first loads, the "Save" button visibility is set to false on the Page_Load event (C# or VB)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not CallbackPanel1.IsCallbackByMe Then
...
ToolBar1.Items(1).Visible = False 'Items(1) = the second button, the "Save" button
...
End If
End Sub

For the javascript - the "setVisible" was what I was looking for!

<script type="text/javascript">
function on_cellEdit(e, info) {
var ToolBar = eo_GetObject("ToolBar1");
var ToolBarItem = ToolBar.getItem(1);
ToolBarItem.setVisible(true);
}
</script>

note: .getItem(1) is the "Save" button.

Anyway - thanks very much!
That was just what I needed to get over the hurdle!

Bill
eo_support
Posted: Wednesday, November 10, 2010 11:24:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Glad that it works for you!


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.