Kendo UI treelist hide button










0















I am using Kendo UI TreeList & Grid for jquery. I want to hide a command button based on row values. In grid, I attached dataBound event to evaluate the model value and show/hide command button, below codes works fine



dataBound:function(e)
var delButton = e.container.find(".k-grid-Delete");
if (...) delButton.hide();



For TreeList, the same code seems also fine. However, when I add inline edit featrue, the same codes works differently.
When click "Edit" or "Add", the grid stay the original visible status, but treelist show all the button.
When click "Cancel", I triggered dataBound event in cancel event so the UI can be refreshed, then the grid show correctly but treelist still show all the buttons even if the dataBound is executed with correct logic.



Does anybody know how to resolve this issue?
Thanks,
Ziff Dai










share|improve this question






















  • Would it be a problem to remove the button instead of just hide it? delButton.remove();

    – Jörgen Moen
    Nov 16 '18 at 8:39












  • Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

    – Ziff
    Nov 19 '18 at 0:51











  • That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

    – Jörgen Moen
    Nov 19 '18 at 12:47















0















I am using Kendo UI TreeList & Grid for jquery. I want to hide a command button based on row values. In grid, I attached dataBound event to evaluate the model value and show/hide command button, below codes works fine



dataBound:function(e)
var delButton = e.container.find(".k-grid-Delete");
if (...) delButton.hide();



For TreeList, the same code seems also fine. However, when I add inline edit featrue, the same codes works differently.
When click "Edit" or "Add", the grid stay the original visible status, but treelist show all the button.
When click "Cancel", I triggered dataBound event in cancel event so the UI can be refreshed, then the grid show correctly but treelist still show all the buttons even if the dataBound is executed with correct logic.



Does anybody know how to resolve this issue?
Thanks,
Ziff Dai










share|improve this question






















  • Would it be a problem to remove the button instead of just hide it? delButton.remove();

    – Jörgen Moen
    Nov 16 '18 at 8:39












  • Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

    – Ziff
    Nov 19 '18 at 0:51











  • That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

    – Jörgen Moen
    Nov 19 '18 at 12:47













0












0








0








I am using Kendo UI TreeList & Grid for jquery. I want to hide a command button based on row values. In grid, I attached dataBound event to evaluate the model value and show/hide command button, below codes works fine



dataBound:function(e)
var delButton = e.container.find(".k-grid-Delete");
if (...) delButton.hide();



For TreeList, the same code seems also fine. However, when I add inline edit featrue, the same codes works differently.
When click "Edit" or "Add", the grid stay the original visible status, but treelist show all the button.
When click "Cancel", I triggered dataBound event in cancel event so the UI can be refreshed, then the grid show correctly but treelist still show all the buttons even if the dataBound is executed with correct logic.



Does anybody know how to resolve this issue?
Thanks,
Ziff Dai










share|improve this question














I am using Kendo UI TreeList & Grid for jquery. I want to hide a command button based on row values. In grid, I attached dataBound event to evaluate the model value and show/hide command button, below codes works fine



dataBound:function(e)
var delButton = e.container.find(".k-grid-Delete");
if (...) delButton.hide();



For TreeList, the same code seems also fine. However, when I add inline edit featrue, the same codes works differently.
When click "Edit" or "Add", the grid stay the original visible status, but treelist show all the button.
When click "Cancel", I triggered dataBound event in cancel event so the UI can be refreshed, then the grid show correctly but treelist still show all the buttons even if the dataBound is executed with correct logic.



Does anybody know how to resolve this issue?
Thanks,
Ziff Dai







kendo-ui






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 4:35









ZiffZiff

64




64












  • Would it be a problem to remove the button instead of just hide it? delButton.remove();

    – Jörgen Moen
    Nov 16 '18 at 8:39












  • Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

    – Ziff
    Nov 19 '18 at 0:51











  • That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

    – Jörgen Moen
    Nov 19 '18 at 12:47

















  • Would it be a problem to remove the button instead of just hide it? delButton.remove();

    – Jörgen Moen
    Nov 16 '18 at 8:39












  • Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

    – Ziff
    Nov 19 '18 at 0:51











  • That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

    – Jörgen Moen
    Nov 19 '18 at 12:47
















Would it be a problem to remove the button instead of just hide it? delButton.remove();

– Jörgen Moen
Nov 16 '18 at 8:39






Would it be a problem to remove the button instead of just hide it? delButton.remove();

– Jörgen Moen
Nov 16 '18 at 8:39














Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

– Ziff
Nov 19 '18 at 0:51





Jorgen, the button will show again even if I use remove instead of hide. I also notice that if I click "collapse" icon, the removed/hidden button will also be shown. I make a break point on dataBound event and see that the button is already hidden, but after that it show again. It seems that some events occurred after dataBound that redrawn the button.

– Ziff
Nov 19 '18 at 0:51













That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

– Jörgen Moen
Nov 19 '18 at 12:47





That's strange, I normally removes delete/change buttons on rows on dataBound event depending on if they should be edit/delete-able. I have in other places been forced to delay my function so that the grid has been drawn (setTimeout(myFunction, 500)), but I never had to do it on the buttons, hope someone has a good solution!

– Jörgen Moen
Nov 19 '18 at 12:47












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331499%2fkendo-ui-treelist-hide-button%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331499%2fkendo-ui-treelist-hide-button%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線