PDA

View Full Version : [CLOSED] ImageCommand missing in Razor syntax



machinableed
Apr 10, 2012, 5:34 AM
I'm trying to replicate something like the following example in Razor Syntax:

<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Company" DataIndex="company" Flex="1">
<Commands>
<ext:ImageCommand CommandName="Edit" Icon="NoteEdit" Text="Edit">
<ToolTip Text="Edit" />
</ext:ImageCommand>
</Commands>
</ext:Column>
</Columns>
</ColumnModel>

but I am unable to add a ImageCommand to the Commands collection - the closest thing I can see is commands.Add(Html.X().ImageCommandColumn()

Daniil
Apr 10, 2012, 9:14 AM
Hi,

Confirmed, ImageCommand is missed in Html.X(). We will fix. Thanks for the report.

For now you can create ImageCommand via its constructor.

Example

.ColumnModel(cm =>
cm.Add(Html.X().Column()
.DataIndex("test")
.Commands(commands =>
commands.Add(new ImageCommand()
{
Icon = Icon.Accept
})
)
)
)

machinableed
Apr 10, 2012, 12:35 PM
Is there any way I can add a tooltip to the imagecommand in this way? It gives me a message saying the tooltip property is read-only...

Daniil
Apr 10, 2012, 2:26 PM
This way:

commands.Add(new ImageCommand()
{
Icon = Icon.Accept,
ToolTip =
{
Text = "Hello!"
}
})

Daniil
Apr 16, 2012, 12:05 PM
Confirmed, ImageCommand is missed in Html.X(). We will fix. Thanks for the report.


It has been fixed in SVN. Thanks again for the report.