jQuery UI Widgets › Forums › Navigation › Tabs › updatebounddata within tab/gird issue
This topic contains 5 replies, has 3 voices, and was last updated by Dimitar 9 years, 2 months ago.
-
Author
-
I have a work flow application that has been working for a couple of years. As the user moves from Tab to Tab edit grid data the work flow status changes which is picked up in the next tab/grid or work flow stage. When the use clicks a tab I had to refresh the data or updatebounddata to show the change in the grid.
With the new release this updatebounddata on the tab click is not working. Can anyone help with a suggestion on a different way to accomplish is that might work.
<script type=”text/javascript”>
$(document).ready(function () {
//Tab Record Count
$(“#jqxgridTab1”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridTab1”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab1’)”).text(“Tab1 ” + records);
}
});//Tab Record Count
$(“#jqxgridTab2”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridTab2”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab2’)”).text(“Tab2 ” + records);
}
});//Tab Record Count
$(“#jqxgridTab3”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridBidReview”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab3’)”).text(“Tab3 ” + records);
}
});//Tab Record Count
$(“#jqxgridTab4”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridTab4”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab4’)”).text(“Tab4 ” + records);
}
});//Tab Record Count
$(“#jqxgridTab5”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridTab5”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab5’)”).text(“Tab5 ” + records);
}
});//Tab Record Count
$(“#jqxgridTab6”).bind(“bindingcomplete”, function (event) {
var datainformation = $(“#jqxgridTab6”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab6’)”).text(“Tab6 ” + records + ” (90 Days)”);
}
});//Selected event
$(“#jqxTabs”).on(“tabclick”, function (event) {
// On Tab Click Refresh Work Flow Data in Grids
var item = event.args.item;
var title = $(“#jqxTabs”).jqxTabs(“getTitleAt”, item);if (title.substring(0, 7) == “Tab1”) {
$(“#jqxgridTab1”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab1”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab1’)”).text(“Tab1 ” + records);
}
}if (title.substring(0, 8) == “Tab2”) {
$(“#jqxgridTab2”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab2”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab2’)”).text(“Tab2 ” + records);
}
}if (title.substring(0, 6) == “Tab3”) {
$(“#jqxgridTab3”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab3”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab3’)”).text(“Tab3 ” + records);
}
}if (title.substring(0, 8) == “Tab4”) {
$(“#jqxgridTab4”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab4”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab4’)”).text(“Tab4 ” + records);
}
}if (title.substring(0, 3) == “Tab5”) {
$(“#jqxgridTab5”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab5”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab5’)”).text(“Tab5 ” + records);
}
}if (title.substring(0, 7) == “Tab6”) {
$(“#jqxgridTab6”).jqxGrid(‘updatebounddata’,’sort’);
var datainformation = $(“#jqxgridTab6”).jqxGrid(‘getdatainformation’);
var records = datainformation.rowscount;
if (records > 0) {
$(“.jqx-tabs-titleContentWrapper:contains(‘Tab6’)”).text(“Tab6 ” + records + ” (90 Days)”);
}
}
});
});
</script>
</head>
<body>
<div id=”container”>
<div id=”message”></div>
<div id=”jqxNavigationBar”>
<div>Work Flow View</div>
<div id=”jqxTabs”>- Tab1
- Tab2
- Tab3
- Tab4
- Tab5
- Tab6
<div id=”jqxgridTab1″></div>
<div id=”jqxgridTab2″></div>
<div id=”jqxgridTab3″></div>
<div id=”jqxgridTab4″></div>
<div id=”jqxgridTab5″></div>
<div id=”jqxgridTab6″></div>
</div>
</div>
</div>
</body>
</html>Hello DavidSimmons,
Is there any error thrown in the browser’s console? Make sure you do not call any methods (including updatebounddata) on grids that have not been initialized yet and that you initialize them in the jqxTabs callback function initTabContent (demo).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I get no errors…
Hi DavidSimmons,
And have you implemented our suggestions from my previous post?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
I’am not sure if this is the same issue as with the thread starter but I have a problem with updatbounddata for my grid in a tab. I have 2 tabs with grids in it. I have a filtering facility that gets a new set of data which will be bound to those grids. However, I noticed that I need to click on the tabs (especially for the 2nd tab) for the updatebounddata to work.
My question is how do we update the source even without clicking the tab?
Hope you get my point.
Thanks!
Hi Karen,
You cannot, because the grid in the second tab has to be initialized first, which happens when the second tab is clicked for the first time and initTabContent is invoked for it.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.