artem_niko Posted February 27, 2020 Share Posted February 27, 2020 Hello! I have UniDBGrid and SQL query for database. SQL query return from database something value. For example, integer=1. I use UniDBGrid.OnBodyDblClick for execute this query. If query return value=0 then RowEditor not show. Else RowEdit will be show. Problem in RowEditor. RowEditor ignore returning value and always showing in UniDBGrid. What must do that RowEditor will be showing if returnig value=1? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2020 Share Posted February 27, 2020 3 hours ago, Артем said: What must do that RowEditor will be showing if returnig value=1? Hello, As always with the desire to help you... But please explain in more detail. Your question is not clear to me. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted February 27, 2020 Author Share Posted February 27, 2020 4 minutes ago, Sherzod said: Hello, As always with the desire to help you... But please explain in more detail. Your question is not clear to me. Ok, I’ll try to explain again.I make a request to the database and as a result of its execution I get a value of either 1 or 0.If 1, then we show the Roweditor in the OnBodyDblClick event. Otherwise, we do not show in this event. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 1, 2020 Author Share Posted March 1, 2020 Can somebody help me? Or this is very strong problem and she have't solution? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2020 Share Posted March 1, 2020 9 minutes ago, Артем said: Can somebody help me? Or this is very strong problem and she have't solution? Артем, Sorry, but the problem for me is that, the question is not clear to me... Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 1, 2020 Author Share Posted March 1, 2020 7 minutes ago, Sherzod said: Артем, Sorry, but the problem for me is that, the question is not clear to me... Давайте я на нашем языке спрошу) Вот скажите мне: как, в RunTime, отключить RowEditor в событии UniDBGrid.OnBodyDblClick? Я нахожусь в таблице, мне надо программно не показывать его при двойном нажатии. Разве даже через JS нельзя сделать это? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2020 Share Posted March 1, 2020 Может Вам нужно просто использовать: UniDBGrid.ReanOnly := True/False ? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 1, 2020 Author Share Posted March 1, 2020 3 minutes ago, Sherzod said: Может Вам нужно просто использовать: UniDBGrid.ReanOnly := True/False ? Это будет работать, если я уже нахожусь в UniDBGrid? Ведь сначала срабатывает OnBodyDblClick, получаю нужное значение, перезагружаю данные, а уже потом мне надо отключить возможность редактирования записи (скрыть RowEditor или ReadOnly=True, смотря что поможет). Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2020 Share Posted March 1, 2020 Вот еще JS код... MainForm.UniDBGrid1.editingPlugin.disable(); MainForm.UniDBGrid1.editingPlugin.enable(); Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 1, 2020 Author Share Posted March 1, 2020 1 minute ago, Sherzod said: Вот еще JS код... MainForm.UniDBGrid1.editingPlugin.disable(); MainForm.UniDBGrid1.editingPlugin.enable(); Что он делает? Позволяет не показать/показать RowEditor? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 1, 2020 Share Posted March 1, 2020 Можно сказать, что да. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 2, 2020 Author Share Posted March 2, 2020 20 hours ago, Sherzod said: Можно сказать, что да. А что-то нет такого кода у меня... Как и где использовать этот JS код? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 1 minute ago, Артем said: А что-то нет такого кода у меня... Да, это: 20 hours ago, Sherzod said: JS код... Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 2, 2020 Author Share Posted March 2, 2020 1 minute ago, Sherzod said: Да, это: Как и где использовать этот JS код? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 2 minutes ago, Артем said: Как и где использовать этот JS код? Можете использовать на стороне клиента, и на стороне сервера. На стороне сервера к примеру: UniDBGrid1.JSInterface.JSCall('editingPlugin.disable', []); UniDBGrid1.JSInterface.JSCall('editingPlugin.enable', []); Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 2, 2020 Author Share Posted March 2, 2020 6 minutes ago, Sherzod said: Можете использовать на стороне клиента, и на стороне сервера. На стороне сервера к примеру: UniDBGrid1.JSInterface.JSCall('editingPlugin.disable', []); UniDBGrid1.JSInterface.JSCall('editingPlugin.enable', []); А что за параметр в квадратных скобках? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 1 minute ago, Артем said: А что за параметр в квадратных скобках? Аргументы функции. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 2, 2020 Author Share Posted March 2, 2020 23 minutes ago, Sherzod said: Аргументы функции. Странно как-то код работает, словно через раз. Поместил код включения/отключения RowEditor в событие OnBodyDblClick, но, то работает, то нет, то RowEditor отключается и остается обычное текстовое поле со значением... Может я не в то событие поместил? Ведь если в UniEdit2 я пишу значение=1, то надо ли перезагружать набор данных заново, чтобы код отключения возможности редактирования работал или он сразу срабатывать должен? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 2, 2020 Share Posted March 2, 2020 3 minutes ago, Артем said: Странно как-то код работает, словно через раз. Артем, я понимаю что Вы тестируете все это на своем проекте... Простите, что возможно я не полностью понимаю Ваш случай и даю, возможно, "неправильные" советы. Может лучше, сделаете тестовый случай? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted March 2, 2020 Author Share Posted March 2, 2020 4 minutes ago, Sherzod said: Артем, я понимаю что Вы тестируете все это на своем проекте... Простите, что возможно я не полностью понимаю Ваш случай и даю, возможно, "неправильные" советы. Может лучше, сделаете тестовый случай? Возможно, что к концу недели я попробую сделать тестовый случай... Quote Link to comment Share on other sites More sharing options...
Jassiv Guerrero Posted March 11, 2020 Share Posted March 11, 2020 Hi Sherzod Is there anything equivalent to this for mobile Grid? UniDBGrid1.JSInterface.JSCall('editingPlugin.disable', []); UniDBGrid1.JSInterface.JSCall('editingPlugin.enable', []); Thanks in Advance Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 11, 2020 Share Posted March 11, 2020 1 hour ago, Jassiv Guerrero said: Is there anything equivalent to this for mobile Grid? Hello, First of all, do you mean this demo example? \FMSoft\Framework\uniGUI\Demos\Touch\DBGrid Editors Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.