I have created breadcrumbs dynamically using jquery but the problem I am going through is on click the previous value disappears and a new value will appear in place of that.
Anyone help me out with this how I can create dynamic breadcrumbs
This is how I have to try to create breadcrumbs:
<div id="rdDataTableDiv-ddt"><table style="width: 500px;" class="rdThemeDataTable ThemeAlignCenter" id="ddt"><colgroup><col id="colEmployeeID"><col id="colEmployeeName"></colgroup><thead style="display:table-header-group"><tr><th scope="col" class="rdThemeDataTableHeader" id="colEmployeeID-TH">EmployeeID</th><th scope="col" class="rdThemeDataTableHeader" id="colEmployeeName-TH">Employee Name</th></tr></thead><tbody><tr row="1"><td id="colEmployeeID_Row1" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=1&passedValue=&prev=&selectedLabel=1&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row1">1</span></a></td><td id="colEmployeeName_Row1" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row1">Jack</span></td></tr>
<tr row="2"><td id="colEmployeeID_Row2" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=2&passedValue=&prev=&selectedLabel=2&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row2">2</span></a></td><td id="colEmployeeName_Row2" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row2">Smith</span></td></tr>
<tr row="3"><td id="colEmployeeID_Row3" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=3&passedValue=&prev=&selectedLabel=3&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row3">3</span></a></td><td id="colEmployeeName_Row3" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row3">Kate</span></td></tr>
<tr row="4"><td id="colEmployeeID_Row4" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=4&passedValue=&prev=&selectedLabel=4&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row4">4</span></a></td><td id="colEmployeeName_Row4" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row4">Donald</span></td></tr>
<tr row="5"><td id="colEmployeeID_Row5" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=5&passedValue=&prev=&selectedLabel=5&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row5">5</span></a></td><td id="colEmployeeName_Row5" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row5">Micky</span></td></tr>
<tr row="6"><td id="colEmployeeID_Row6" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=6&passedValue=&prev=&selectedLabel=6&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row6">6</span></a></td><td id="colEmployeeName_Row6" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row6">Rick</span></td></tr>
<tr row="7"><td id="colEmployeeID_Row7" class="rdThemeDataTableCell items"><a href="javascript:void(0);" onclick="rdAjaxRequestWithFormVars('rdAjaxCommand=RefreshElement&rdRefreshElementID=anvita&empID=7&passedValue=&prev=&selectedLabel=7&shwDetail=2&rdReport=Breadcrumbs','false','',null,null,null,['','',''],true);"><span id="lblEmployeeID_Row7">7</span></a></td><td id="colEmployeeName_Row7" class="rdThemeDataTableCell"><span id="lblEmployeeName_Row7">Jill</span></td></tr>
</tbody></table><div id="rdDataTableDivEnd-ddt"></div></div>
This is the table I have created so the logic I have applied on click on employee id it appears as breadcrumb with link
this is the jquery I have used
$('.items a').on('click', function() {
var $this = $(this),
$bc = $('<div class="item"></div>');
$this.parents('td').each(function(n, td) {
var $a = $(td).children('a').clone();
$bc.prepend(' / ', $a);
});
$('.breadcrumb').html($bc.prepend('<a href="#home">Home</a>'));
return false;
})
What I want is to create breadcrumbs trails with the links