PDA

View Full Version : [CLOSED] slidertip not show on button click



UT007
Oct 27, 2013, 2:18 PM
7126

7125

when i click button tooltip text not show .


7124




<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="DeskTop_HistoryTrack_Default" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>
<style>


#custom-slider .x-slider-thumb {
background-image : url(resources/images/slider-thumb.png);
}

</style>

<script>

var play = function () {
var slider = App.Slider1,
value = slider.getValue()[0];

value += slider.increment;
slider.setValue([value]);

};

var first = function () {
App.direct.LogMessagefirst({
success: function (index) {
}
});
};
var last = function () {
App.direct.LogMessagelast({
success: function (index) {


}

});


};
var next = function () {
var slider = App.Slider1, slidertip = App.SliderTip1,
value = slider.getValue()[0];
App.direct.LogMessagenext(value, {
success: function (index) {

var me = this;
me.show();
me.update(me.getText(thumb));
me.el.alignTo(thumb.el, me.align, me.offsets);

}
});
};
var previous = function () {
var slider = App.Slider1,
value = slider.getValue()[0];
App.direct.LogMessageprevious(value,{
success: function (index) {

}
});
};
/**
* @private
* Called whenever a dragstart or drag event is received on the associated Thumb.
* Aligns the Tip with the Thumb's new position.
* @param {Ext.slider.MultiSlider} slider The slider
* @param {Ext.EventObject} e The Event object
* @param {Ext.slider.Thumb} thumb The thumb that the Tip is attached to
*/
// var onSlide =function(slider, e, thumb) {
// var me = this;
// me.show();
// me.update(me.getText(thumb));
// me.el.alignTo(thumb.el, me.align, me.offsets);
// }

/**
* Used to create the text that appears in the Tip's body. By default this just returns the value of the Slider
* Thumb that the Tip is attached to. Override to customize.
* @param {Ext.slider.Thumb} thumb The Thumb that the Tip is attached to
* @return {String} The text to display in the tip
* @protected
* @template
*/
var getText = function(thumb) {
return String(thumb.value);
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:TaskManager ID="TaskManager1" runat="server">
<Tasks>
<ext:Task TaskID="PlayTask" Interval="1000" AutoRun="false">
<Listeners>
<Update Fn="play" />
</Listeners>
</ext:Task>

</Tasks>
</ext:TaskManager>
<table >
<tr>
<td >
<div id="custom-slider">
<ext:Slider ID="Slider1" runat="server" Width="200"
MinValue="0"
MaxValue="200"
Increment="1">

<Plugins>
<ext:SliderTip ID="SliderTip1" runat="server">
<GetText Fn="function (slider) { return Ext.String.format('<b>{0}% complete</b>', slider.value); }" />

</ext:SliderTip>
</Plugins>
</ext:Slider>
<%--<ext:Slider
ID="Slider1"
runat="server"
Width="200"
MinValue="0"
MaxValue="200"
Increment="1" />--%>
</div>
</td>

<td style="height:10px;">
<ext:Button ID="Play" runat="server" Text="Play" Handler="App.TaskManager1.startTask('PlayTask');" />
</td>
<td style="height:10px;">
<ext:Button ID="Pause" runat="server" Text="Pause" Handler="App.TaskManager1.stopTask('PlayTask');" />

</td>
<td style="height:10px;">
<ext:Button ID="Button1" runat="server" Text="First">
<Listeners>
<Click Fn="first" />
</Listeners>
</ext:Button>
</td>
<td style="height:10px;">
<ext:Button ID="Button3" runat="server" Text="Next">
<Listeners>
<Click Fn="next" />
</Listeners>
</ext:Button>
</td>
<td style="height:10px;">
<ext:Button ID="Button4" runat="server" Text="Previous">
<Listeners>
<Click Fn="previous" />
</Listeners>
</ext:Button>
</td>
<td style="height:10px;">
<ext:Button ID="Button2" runat="server" Text="Last">
<Listeners>
<Click Fn="last" />
</Listeners>
</ext:Button>
</td>
</tr>
<tr>



</tr>
</table>

</form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

public partial class DeskTop_HistoryTrack_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
[DirectMethod]
public void LogMessagefirst()
{
double val = Slider1.MinValue;
Slider1.SetValue(val);
Slider1.ShowIndicator();
}
[DirectMethod]
public void LogMessagelast()
{
double val = Slider1.MaxValue;
Slider1.SetValue(val);
}
[DirectMethod]
public void LogMessagenext(double val)
{
Slider1.SetValue(val + 1);

}
[DirectMethod]
public void LogMessageprevious(double val)
{
Slider1.SetValue(val-1);
}
}

Daniil
Oct 28, 2013, 5:37 AM
Hi @UT007,

What button do you click? A Slider's one? Or a regular Button which you assigned a JavaScript handler to?

Could you, please, post a test case directly here wrapping in code tags instead of attaching it?

Daniil
Nov 01, 2013, 5:06 AM
Thank you.

So, what are the exact steps to reproduce the problem?