PDA

View Full Version : [CLOSED] gridpanel - component column ToolTip



PriceRightHTML5team
Oct 09, 2014, 8:02 AM
Hi,

Mine is an asp.net MVC Razor View application.

I have a gridpanel having component column. The component column has Combobox.
Following is the markup of the ComponentColumn.



Html.X().ComponentColumn()
.Editor(true)
.Sortable(false)
.DataIndex("cpt")
.Flex(1)
//.Listeners(ls => ls.Edit.Fn = "cmbCPTChange")
.Text("cpt")
.Component(Html.X().ComboBox()
.Editable(false)
.EmptyText("Select cpt")
.ValueField("cptCD")
.DisplayField("cptDESC")
.Listeners(ls => ls.Change.Fn = "SetDirty")
.Store(Html.X().Store()
.Model(Html.X().Model()
.Fields(
new ModelField("cptCD", ModelFieldType.String),
new ModelField("cptDESC", ModelFieldType.String)
)
)
.DataSource(Model.cptList)
)


I have used below ToolTip control to show tooltips.


@(Html.X().ToolTip().ID("ttpgrdPackPriceAttributes")
.Target("={#{grdPackPriceAttributes}.getView().el}")
.Delegate(".x-grid-cell")
.TrackMouse(true)
.Listeners(ls => { ls.Show.Handler = "onShow(this, #{grdPackPriceAttributes});"; })
)

The issue am facing is on mouseover of the component column row cell in the tooltip it shows 'ValueField' value instead of 'DisplayField'

Below is the snap of it.
http://forums.ext.net/attachment.php?attachmentid=15461&stc=1

Daniil
Oct 09, 2014, 8:45 AM
Hi @PriceRightHTML5team,

I guess it shows the cell's value according

.DataIndex("cpt")
as it is written in the onShow method.

You should probably change the onShow method.

PriceRightHTML5team
Oct 09, 2014, 11:43 AM
Hi Daniil,
Thanks for your reply.I updated the onshow() function and it worked.

Further i need to add tooltip to the combobox list items. Thus, i added ID to the combobox.


Html.X().ComponentColumn()
.Editor(true)
.ID(cmbEx_Factory)
.Sortable(false)
.DataIndex("cpt")
.Flex(1)
//.Listeners(ls => ls.Edit.Fn = "cmbCPTChange")
.Text("cpt")
.Component(Html.X().ComboBox()
.Editable(false)
.EmptyText("Select cpt")
.ValueField("cptCD")
.DisplayField("cptDESC")
.Listeners(ls => ls.Change.Fn = "SetDirty")
.Store(Html.X().Store()
.Model(Html.X().Model()
.Fields(
new ModelField("cptCD", ModelFieldType.String),
new ModelField("cptDESC", ModelFieldType.String)
)
)
.DataSource(Model.cptList)
)

And added a new tooltip control.



@(Html.X().ToolTip().ID("ttpcmbEx_Factory")
.Target("={#{cmbEx_Factory}.list}")
.Delegate(".x-combo-list-item")
.TrackMouse(true)
.Listeners(ls => { ls.Show.Handler = "this.body.update(this.triggerElement.innerHTML);"; })
)

But tooltip is not getting shown.

Daniil
Oct 09, 2014, 8:09 PM
I think it is better to start a new forum thread.