0
私はこれまで少しでも運がなかったので、私は何かを捨てると思った。clickイベントソースがtheadから来ているかどうかを確認
thead
ではなく、tbody
からのソースである場合にのみ、Angularディレクティブでclickイベントの機能が実行される必要があります。私はこの情報を得るためにいくつかのルートを試しましたが、私は正しい構文を得ることができません。
ご迷惑をおかけして申し訳ございません。ここに私の最新の/最善の試みがあります。私はあなたに何が起こっているのかを伝えます。
/* Linker for the directive */
var linker = function (scope, elm, attrs) {
window.setTimeout(function(){
elm.find('table tbody tr.uib-weeks td button span.text-info').closest('tr').find('button').addClass('chosenReportWeek');
}, 1000); // This is a hack until we can find the proper load/render event
elm.on('click', function(event) {
if(event.target.parent.indexOf('thead') === -1){
elm.find('table tbody tr.uib-weeks button.active').closest('tr').find('button').addClass('chosenReportWeek');
}
});
};
'(。$(event.target).closest( 'TBODY')の長さ){...' – adeneo
が持っていた場合は ' 'thead要素にそれを変更するには'' closest'で動作しますが、動作します。ありがとう! – NealR
あなたはようこそ! – adeneo