Skip to content

934883: Test and resolve issues in UG all sections - ASP core Tooltip control #3833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 24 additions & 66 deletions ej2-asp-core-mvc/code-snippet/tooltip/ajaxcontent/tagHelper
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
<div id='container'>
<h4 class="list-header">National Sports</h4>
<!-- Tooltip element rendering for AjaxContent loading -->
<ejs-tooltip id="Tooltip" content="Loading..." beforeRender="onBeforeRender" target="#countrylist [title]" showTipPointer="true" position="RightCenter">
<e-content-template>
<!-- ListView element -->
<ejs-listview id="countrylist" dataSource="ViewBag.data" enable="true">
<e-listview-fieldsettings text="text" tooltip="id"></e-listview-fieldsettings>
</ejs-listview>
</e-content-template>
</ejs-tooltip>
</div>

<div id='container'>
<h4 class="list-header">National Sports</h4>
<!-- Tooltip element rendering for AjaxContent loading -->
<ejs-tooltip id="Tooltip" content="Loading..." beforeRender="onBeforeRender" target="#countrylist [title]" showTipPointer="true" position="RightCenter">
<e-content-template>
<!-- ListView element -->
<ejs-listview id="countrylist" dataSource="ViewBag.data" enable="true">
<e-listview-fieldsettings text="text" tooltip="id"></e-listview-fieldsettings>
</ejs-listview>
</e-content-template>
</ejs-tooltip>
</div>


<script>
/**
* Process tooltip ajax content.
*/
function onBeforeRender(args) {
var _this = this;
this.content = 'Loading...';
this.dataBind();
var fetchApi = new ej.base.Fetch("@Url.Content("~/Scripts/tooltip/tooltipdata.json")", 'GET');
fetchApi.send().then(function (result) {
/**
* Process tooltip ajax content.
*/
function onBeforeRender(args) {
var _this = this;
this.content = 'Loading...';
this.dataBind();
var fetchApi = new ej.base.Fetch("@Url.Content("~/script/tooltip/tooltipdata.json")", 'GET');
fetchApi.send().then(function (result) {
for (var i = 0; i < result.length; i++) {
if (result[i].Id === args.target.getAttribute('data-content')) {
_this.content = "<div class='contentWrap'><span class=" + result[i].Class + "></span><div class='def'>" + result[i].Sports + "</div></div>";
_this.content = "<div class='contentWrap'><div class='def'>" + result[i].Sports + "</div></div>";
}
}
_this.dataBind();
Expand All @@ -34,51 +35,8 @@
});
}
</script>
<link href="~/css/tooltip/icons.css" rel="stylesheet" />
<style>

.e-bigger [class^="sports-icon-"],
.e-bigger [class*=" sports-icon-"] {
font-size: 18px;
}

[class^="sports-icon-"],
[class*=" sports-icon-"] {
font-family: 'sportsicons';
speak: none;
font-size: 16px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
padding-right: 6px;
vertical-align: middle;
}

.sports-icon-cricket:before {
content: "\e703";
}

.sports-icon-archery:before {
content: "\e705";
}

.sports-icon-table-tennis:before {
content: "\e702";
}

.sports-icon-baseball:before {
content: "\e706";
}

.sports-icon-hockey:before {
content: "\e701";
}

.sports-icon-shooting:before {
content: "\e700";
}

.def {
float: right;
}
Expand All @@ -105,4 +63,4 @@
text-align: left;
}
}
</style>
</style>
44 changes: 44 additions & 0 deletions ej2-asp-core-mvc/code-snippet/tooltip/ajaxcontent/tooltipdata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"Id": "1",
"Country": "Australia",
"Sports": "Cricket",
"Class": "sports-icon-cricket"
},
{
"Id": "2",
"Country": "Bhutan",
"Sports": "Archery",
"Class": "sports-icon-archery"
},
{
"Id": "3",
"Country": "China",
"Sports": "Table tennis",
"Class": "sports-icon-table-tennis"
},
{
"Id": "4",
"Country": "Cuba",
"Sports": "Baseball",
"Class": "sports-icon-baseball"
},
{
"Id": "5",
"Country": "India",
"Sports": "Hockey",
"Class": "sports-icon-hockey"
},
{
"Id": "6",
"Country": "Switzerland",
"Sports": "Shooting",
"Class": "sports-icon-shooting"
},
{
"Id": "7",
"Country": "United States",
"Sports": "Baseball",
"Class": "sports-icon-baseball"
}
]
26 changes: 11 additions & 15 deletions ej2-asp-core-mvc/code-snippet/tooltip/animation-default/tagHelper
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<ejs-tooltip id="tooltip" content= "Tooltip content" animation="ViewBag.animation">
<e-content-template>
<div id="target">
Show tooltip
</div>
</e-content-template>
</ejs-tooltip>
<ejs-tooltip id="tooltip" content="Tooltip content" animation="ViewBag.animation" position="TopCenter">
<e-content-template>
<ejs-button id="target" content="Show tooltip">
</ejs-button>
</e-content-template>
</ejs-tooltip>


<style>

#target {
background-color: #ececec;
border: 1px solid #c8c8c8;
box-sizing: border-box;
margin: 50px auto;
padding: 10px;
width: 100px;
#tooltip {
position: absolute;
left: calc( 50% - 60px);
top: 38%;
}
</style>
</style>
27 changes: 12 additions & 15 deletions ej2-asp-core-mvc/code-snippet/tooltip/animation-openclose/tagHelper
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<ejs-tooltip id="tooltip" content="Tooltip content" opensOn="Custom" created="created">
<e-content-template>
<div id="target">
Show tooltip
</div>
</e-content-template>
</ejs-tooltip>

<ejs-tooltip id="tooltip" content="Tooltip content" opensOn="Custom" created="created" position="TopCenter">
<e-content-template>
<ejs-button id="target" content="Show tooltip">
</ejs-button>
</e-content-template>
</ejs-tooltip>

<style>
#target {
background-color: #ececec;
border: 1px solid #c8c8c8;
box-sizing: border-box;
margin: 50px auto;
padding: 10px;
width: 100px;
#tooltip {
position: absolute;
left: calc( 50% - 60px);
top: 38%;
}
</style>
<script>
Expand All @@ -29,4 +26,4 @@
}
});
}
</script>
</script>
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<ejs-tooltip id="tooltip" target=".circletool" beforeRender="onBeforeRender" afterClose="onAfterClose" closeDelay=1000 animation="ViewBag.animation">
<e-content-template>
<div>
<h3> Transition effect </h3>
<div id="box" class="e-prevent-select">
<div class="circletool" style="top:18%;left:5%" title="This is Turtle !!!"></div>
<div class="circletool" style="top:30%;left:30%" title="This is Snake !!!"></div>
<div class="circletool" style="top:80%;left:80%" title="This is Croc !!!"></div>
<div class="circletool" style="top:65%;left:50%" title="This is String Ray !!!"></div>
<div class="circletool" style="top:75%;left:15%" title="This is Blob Fish !!!"></div>
<div class="circletool" style="top:30%;left:70%" title="This is Mammoth !!!"></div>
</div>

<ejs-tooltip id="tooltip" target=".circletool" beforeRender="onBeforeRender" afterClose="onAfterClose" closeDelay=1000 animation="ViewBag.animation" position="TopCenter">
<e-content-template>
<div>
<h3> Transition effect </h3>
<div id="box" class="e-prevent-select">
<div class="circletool" style="top:18%;left:5%" title="This is Turtle !!!"></div>
<div class="circletool" style="top:30%;left:30%" title="This is Snake !!!"></div>
<div class="circletool" style="top:80%;left:80%" title="This is Croc !!!"></div>
<div class="circletool" style="top:65%;left:50%" title="This is String Ray !!!"></div>
<div class="circletool" style="top:75%;left:15%" title="This is Blob Fish !!!"></div>
<div class="circletool" style="top:30%;left:70%" title="This is Mammoth !!!"></div>
</div>
</e-content-template>
</ejs-tooltip>
</div>
</e-content-template>
</ejs-tooltip>

<style>
#box {
Expand Down Expand Up @@ -46,4 +47,4 @@
// restore the animation effects
this.animation = { open: { effect: 'ZoomIn', duration: 500 }, close: { effect: 'ZoomOut', duration: 500 } };
}
</script>
</script>
17 changes: 9 additions & 8 deletions ej2-asp-core-mvc/code-snippet/tooltip/custom-mode/tagHelper
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<ejs-tooltip id="box" content="Tooltip from custom mode" OpensOn="Custom" created="created">
<e-content-template>
<div id="content">
Double-click to open Tooltip.
</div>
</e-content-template>
</ejs-tooltip>

<ejs-tooltip id="box" content="Tooltip from custom mode" OpensOn="Custom" created="created" position="TopCenter">
<e-content-template>
<div id="content">
Double-click to open Tooltip.
</div>
</e-content-template>
</ejs-tooltip>

<style>
#box {
Expand All @@ -27,4 +28,4 @@
}
});
}
</script>
</script>
2 changes: 1 addition & 1 deletion ej2-asp-core-mvc/code-snippet/tooltip/delay-mode/tagHelper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ejs-tooltip id="target" content="Tooltip content" openDelay="1000" closeDelay="1000">
<ejs-tooltip id="target" content="Tooltip content" openDelay="1000" closeDelay="1000" position="TopCenter">
<e-content-template>
<div id="content">
Show tooltip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ejs-tooltip id="targetContainer" content="Tooltip content" offsetX="-15" target="#demoSmart">
<ejs-tooltip id="targetContainer" content="Drag me!" position="TopCenter" offsetX="-15" target="#demoSmart">
<e-content-template>
<div id="demoSmart"></div>
</e-content-template>
Expand Down Expand Up @@ -58,4 +58,4 @@
padding: 3px;
margin-right: 20px;
}
</style>
</style>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ejs-tooltip id="tooltip" height="40px" width="150px" content="Tooltip with specific width and height">
<ejs-tooltip id="tooltip" height="50px" width="150px" position="TopCenter" content="Tooltip with specific width and height" position="TopCenter">
<e-content-template>
<span id='target'>Show Tooltip</span>
</e-content-template>
Expand Down
12 changes: 6 additions & 6 deletions ej2-asp-core-mvc/code-snippet/tooltip/open-custom/tagHelper
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<div id='container'>
<div id="showTooltip">
<div id="first">
<ejs-tooltip id="tooltip01" opensOn="Hover" content="Tooltip from hover">
<ejs-tooltip id="tooltip01" position="TopCenter" opensOn="Hover" content="Tooltip from hover">
<e-content-template>
<button class="blocks e-btn e-primary e-outline" id="tooltiphover">Hover me!(Default)</button>
</e-content-template>
</ejs-tooltip>
<ejs-tooltip id="tooltip02" opensOn="Click" content="Tooltip from click">
<ejs-tooltip id="tooltip02" position="TopCenter" opensOn="Click" content="Tooltip from click">
<e-content-template>
<button class="blocks e-btn e-primary e-outline" id="tooltipclick">Click me!</button>
</e-content-template>
</ejs-tooltip>
</div>
<br /><br />
<div id="second">
<ejs-tooltip id="tooltip03" opensOn="Click" isSticky="true" content="Click close icon to close me">
<ejs-tooltip id="tooltip03" position="TopCenter" opensOn="Click" isSticky="true" content="Click close icon to close me">
<e-content-template>
<button class="blocks e-btn e-primary e-outline" id="Mode">Sticky Mode</button>
</e-content-template>
</ejs-tooltip>
<ejs-tooltip id="tooltip06" opensOn="Click" openDelay=1000 closeDelay=1000 content="Opens and closes Tooltip with delay of <i>1000 milliseconds</i>">
<ejs-tooltip id="tooltip06" position="TopCenter" opensOn="Click" openDelay=1000 closeDelay=1000 content="Opens and closes Tooltip with delay of <i>1000 milliseconds</i>">
<e-content-template>
<button class="blocks e-btn e-primary e-outline" id="openMode">Tooltip with delay</button>
</e-content-template>
</ejs-tooltip>
</div>
<br /><br />
<div id="third">
<ejs-tooltip id="customTooltip" opensOn="Custom" content="Tooltip from custom mode">
<ejs-tooltip id="customTooltip" position="TopCenter" opensOn="Custom" content="Tooltip from custom mode">
<e-content-template>
<button class="blocks e-btn e-primary e-outline" id="tooltipcustom">Double click on me!</button>
</e-content-template>
</ejs-tooltip>

<ejs-tooltip id="tooltip05" opensOn="Hover" content="Tooltip from focus">
<ejs-tooltip id="tooltip05" opensOn="Hover" position="TopCenter" content="Tooltip from focus">
<e-content-template>
<div id="textbox" class="e-float-input blocks">
<input id="focus" type="text" placeholder="Focus and blur" />
Expand Down
Loading