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!
|
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.aspxIf 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.aspxYou can set this property to true for the toolbar to post back on click: http://doc.essentialobjects.com/library/1/eo.web.toolbar.autopostback.aspxHope this helps. Please feel free to let us know if you have any more question. Thanks!
|
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
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are very welcome. Glad that it works for you!
|