x11 Posted September 28, 2020 Author Share Posted September 28, 2020 On 9/23/2020 at 2:18 PM, Sherzod said: JSInterface.JSCode(#1'.getStore().add({id: "1", val: "Значение1"});'); А можно таким же способом заполнить TUnimDBLookupComboBox? Что-то не получается. Ошибок нет, но список пустой. procedure comboOnRemoteQuery2(combo: TUnimDBLookupComboBox; q: TUniQuery; const sTable, QueryString: string; var Result: TStrings); Var n: integer; fId, fName: TField; begin q.Close; q.SQL.Text := 'SELECT ID, NAME FROM ' + sTable + ' WHERE UPPER(NAME) CONTAINING(UPPER(:NAME)) AND DELETED IS DISTINCT FROM 1'; if (QueryString.Length <= 2) and (QueryString <> '*') then exit; if (QueryString = '*') or (QueryString = '[null]') then q.Params[0].AsString := '' else q.Params[0].AsString := QueryString; q.Open; if q.RecordCount = 0 then begin Result.Add(constEmptyRes); exit; end; fID := q.FieldByName('id'); fName := q.FieldByName('name'); n := 0; q.First; while not q.Eof do begin combo.JSInterface.JSCode(#1'.getStore().add({"id":' + fID.AsString + ', "val":"' + fName.AsString + '"});'); q.Next; inc(n); if N > 100 then Break; end; end; procedure TfmmSearchParams.comboStreetsRemoteQuery(const QueryString: string; Result: TStrings); begin comboOnRemoteQuery2(comboStreets, qStreets, 'STREETS', QueryString, Result); end; записи в базе точно есть. q.RecordCount показывает 25 записей. Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2020 Share Posted September 28, 2020 7 minutes ago, x11 said: А можно таким же способом заполнить TUnimDBLookupComboBox? Что-то не получается. Ошибок нет, но список пустой. Добрый день, Не пробовали?: 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted September 28, 2020 Author Share Posted September 28, 2020 Вы имеете ввиду, что у меня не хватает строки: JSCall('setValue', [val]); ?? Quote Link to comment Share on other sites More sharing options...
x11 Posted September 28, 2020 Author Share Posted September 28, 2020 while not q.Eof do begin combo.JSInterface.JSCode(#1'.getStore().add({"id":' + fID.AsString + ', "val":"' + fName.AsString + '"});'); combo.JSInterface.JSCall('setValue', [fName.AsString]); пока не помогло Quote Link to comment Share on other sites More sharing options...
x11 Posted September 28, 2020 Author Share Posted September 28, 2020 отладчик показывает, что цикл работает и записи добавляются ... может какое-то свойство влияет? Quote Link to comment Share on other sites More sharing options...
x11 Posted September 29, 2020 Author Share Posted September 29, 2020 UP Quote Link to comment Share on other sites More sharing options...
x11 Posted October 2, 2020 Author Share Posted October 2, 2020 up Quote Link to comment Share on other sites More sharing options...
x11 Posted October 17, 2020 Author Share Posted October 17, 2020 хотелось бы все таки поиметь нормально работающий TUnimDBLookupComboBox с ID (Key) и RemoteQuery Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 On 9/23/2020 at 12:10 PM, Sherzod said: Присвоить значение, примерно так: UnimSelect1.JSInterface.JSCode(#1'.setValue(["3","4","5"]);') Подскажите, числа - это ID? Я вот наполнил список, выбрать ручками в браузере можно, т.е. наполнение и выбор работает. А теперь как программно выбрать нужные записи? Судя по отладчику (картинка 1), передаю значения правильно. Картинка 2 - ничего не выбрано. selPrm.JSInterface.JSCode(sValPrm); Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 8 minutes ago, x11 said: Подскажите, числа - это ID? Значения. Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 полез в консоль, вижу, что эти значения есть Как их программно выбрать? Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 я уже и в консоли выполнил Ext.getCmp("fmmeditapart_selprm_0").setValue(["1","2","3"]); и Ext.getCmp("fmmeditapart_selprm_0").setValue(["23","2","18"]); все равно не выделяется ничего в unimSelect Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 На всякий случай уточню свой вопрос. Сперва заполняю unimSelect. Потом некоторые пункты мне нужно выбрать (выделить) программно. Чтобы пользователь видел, какие пункты уже выбраны и чтобы он мог потом изменить этот выбор. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 3 minutes ago, x11 said: Потом некоторые пункты мне нужно выбрать (выделить) программно. В какой момент? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 Тестовый случай? Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 2 minutes ago, Sherzod said: В какой момент? при загрузке формы (onCreate или onShow) Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 21 minutes ago, Sherzod said: Тестовый случай? Сделал тестовый пример. Кстати, здесь проявляется еще одна ошибка, о которой я писал Вам ранее: добавляю 5 строк, а в браузере вижу только 4. uniGUI_unimSelect.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 52 minutes ago, Sherzod said: 1 hour ago, x11 said: Подскажите, числа - это ID? Значения. 51 minutes ago, x11 said: полез в консоль, вижу, что эти значения есть procedure TMainmForm.UnimFormShow(Sender: TObject); Var sValPrm: string; begin InitSelect; sValPrm := SetSelectedValues('Sergio,Said'); UnimSelect1.JSInterface.JSCode(sValPrm); end; Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 Не, не, так нельзя. Какой смысл во всех этих ID тогда? Поймите, что манипулировать правильно не именами, а ключевыми значениями. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 11 minutes ago, x11 said: Поймите, что манипулировать правильно не именами, а ключевыми значениями. Я проанализирую. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 29 minutes ago, x11 said: Поймите, что манипулировать правильно не именами, а ключевыми значениями. Попробуйте этот конфиг: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin UnimSelect1.JSInterface.JSConfig('valueField', ['id']); end; procedure TMainmForm.UnimFormShow(Sender: TObject); Var sValPrm: string; begin InitSelect; sValPrm := SetSelectedValues('2,18'); UnimSelect1.JSInterface.JSCode(sValPrm); end; 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted October 18, 2020 Author Share Posted October 18, 2020 Супер! Спасибо большое 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 18, 2020 Share Posted October 18, 2020 Quote Link to comment Share on other sites More sharing options...
x11 Posted October 21, 2020 Author Share Posted October 21, 2020 у тем iOS и Material небольшая проблема - кнопка ОК прозрачна. Честно говоря, тема Material это вообще что-то ужасное, по моему скромному мнению. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 21, 2020 Share Posted October 21, 2020 3 hours ago, x11 said: кнопка ОК прозрачна. Эта та кнопка, которую мы с вами добавили!? 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.