MSMK Posted December 13, 2018 Share Posted December 13, 2018 Выполняю .Locate('ID', Value, []). В uniDBTreeGrid не выделяется запись, на которую перешли. Как реализовать данный момент? Это баг? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2018 Share Posted December 13, 2018 Добрый день, Я предполагаю что нод который содержит запись, должна быть раскрыта Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 Just now, Sherzod said: Добрый день, Я предполагаю что нод который содержит запись, должна быть раскрыта получилось полечить указав фокус гриду unidbgrid.SetFocus Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 1 minute ago, Sherzod said: Добрый день, Я предполагаю что нод который содержит запись, должна быть раскрыта а как отобразить запись, если она находится не в поле видимости? При вызове locate, не срабатывает scroll Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 Just now, =GGG= said: а как отобразить запись, если она находится не в поле видимости? При вызове locate, не срабатывает scroll похожая ситуация Но решение не помогло Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2018 Share Posted December 13, 2018 12 minutes ago, =GGG= said: Но решение не помогло Вы пробовали увеличить второй аргумен функции setTimeout?: setTimeout(fn, 500) к примеру Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 Just now, Sherzod said: Вы пробовали увеличить второй аргумен функции setTimeout?: setTimeout(fn, 500) к примеру не пробовал, сейчас проверю Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 6 minutes ago, Sherzod said: Вы пробовали увеличить второй аргумен функции setTimeout?: setTimeout(fn, 500) к примеру не работает Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2018 Share Posted December 13, 2018 Just now, =GGG= said: не работает Можете сделать небольшой тестовый случай ?! Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 13, 2018 Author Share Posted December 13, 2018 1 minute ago, Sherzod said: Можете сделать небольшой тестовый случай ?! сейчас отправит мой коллега Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted December 13, 2018 Share Posted December 13, 2018 28 minutes ago, Sherzod said: Можете сделать небольшой тестовый случай ?! Добрый день. Test.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2018 Share Posted December 13, 2018 Добрый день, Попробуйте это решение: procedure TMainForm.UniButton1Click(Sender: TObject); begin if ClientDataSet1.Locate('Id' ,90, []) then begin //UniSession.AddJS('setTimeout(function(){' + UniDBTreeGrid1.JSName + '.getView().getNode('+ UniDBTreeGrid1.JSName +'.uniRow).scrollIntoView()}, 500)'); UniDBTreeGrid1.JSInterface.JSCode('Ext.defer(function(){'#1'.ensureVisible('#1'.getSelectionModel().getSelected().getAt(0))}, 100);'); end; end; 1 Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted December 13, 2018 Share Posted December 13, 2018 13 minutes ago, Sherzod said: Добрый день, Попробуйте это решение: procedure TMainForm.UniButton1Click(Sender: TObject); begin if ClientDataSet1.Locate('Id' ,90, []) then begin //UniSession.AddJS('setTimeout(function(){' + UniDBTreeGrid1.JSName + '.getView().getNode('+ UniDBTreeGrid1.JSName +'.uniRow).scrollIntoView()}, 500)'); UniDBTreeGrid1.JSInterface.JSCode('Ext.defer(function(){'#1'.ensureVisible('#1'.getSelectionModel().getSelected().getAt(0))}, 100);'); end; end; Спасибо большое. Заработало. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 13, 2018 Share Posted December 13, 2018 2 minutes ago, OlegTimkiv said: Спасибо большое. Заработало. Отлично! Quote Link to comment Share on other sites More sharing options...
MSMK Posted December 14, 2018 Author Share Posted December 14, 2018 14 hours ago, Sherzod said: Добрый день, Попробуйте это решение: procedure TMainForm.UniButton1Click(Sender: TObject); begin if ClientDataSet1.Locate('Id' ,90, []) then begin //UniSession.AddJS('setTimeout(function(){' + UniDBTreeGrid1.JSName + '.getView().getNode('+ UniDBTreeGrid1.JSName +'.uniRow).scrollIntoView()}, 500)'); UniDBTreeGrid1.JSInterface.JSCode('Ext.defer(function(){'#1'.ensureVisible('#1'.getSelectionModel().getSelected().getAt(0))}, 100);'); end; end; Спасибо за оперативность! 1 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.