x11 Posted October 2, 2020 Author Share Posted October 2, 2020 On 8/4/2020 at 12:05 PM, Sherzod said: Вы можете проанализировать и использовать этот подход: @Sherzod получаю ошибку, что надо обработать событие OnGetKeyValue. Ок, а как в этом событии получить ID выбранной строки (выранной записи)? Quote Link to comment Share on other sites More sharing options...
x11 Posted October 2, 2020 Author Share Posted October 2, 2020 еще одна проблема: я вижу только 2 строки, а не три, хотя, исходя из кода, должно быть три строки, из них две строки одинаковые. Т.е. как будто выполняется группировка. procedure TfmmSearchParams.comboStreetsAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'data' then if Params['root'].AsString = 'items' then begin //Здесь Вы можете использовать JSON модули UniSession.SendResponse('[{id: 5, val: "testVal"}, {id: 7, val: "testVal1"}, {id: 8, val: "testVal1"}]'); end; end; Quote Link to comment Share on other sites More sharing options...
x11 Posted October 2, 2020 Author Share Posted October 2, 2020 On 8/4/2020 at 12:05 PM, Sherzod said: Вы можете проанализировать и использовать этот подход: Вот еще странность. Добавляю 4 записи, но вижу 3: UniSession.SendResponse('[{id: 5, val: "testVal"}, {id: 7, val: "testVal1"}, {id: 8, val: "testVal1"}, {id: 9, val: "testVal"}]'); Добавляю 5 записей, но вижу 4: UniSession.SendResponse('[{id: 4, val: "testVal"}, {id: 5, val: "testVal"}, {id: 7, val: "testVal1"}, {id: 8, val: "testVal1"}, {id: 9, val: "testVal"}]'); Quote Link to comment Share on other sites More sharing options...
x11 Posted October 2, 2020 Author Share Posted October 2, 2020 фильтр не работает и в список попадает только первые 4 записи procedure TfmmSearchParams.comboStreetsAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'data' then if Params['root'].AsString = 'items' then begin // вставка записей UniSession.SendResponse('[{id: 4, val: "Val4"}, {id: 5, val: "Record5"}, {id: 7, val: "testVal1"}, {id: 8, val: "testVal1"}, {id: 9, val: "testVal9"}, {id: 9, val: "testVal9"}]'); end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 2, 2020 Share Posted October 2, 2020 1 hour ago, x11 said: фильтр не работает и в список попадает только первые 4 записи Я проверю. Quote Link to comment Share on other sites More sharing options...
x11 Posted December 5, 2020 Author Share Posted December 5, 2020 Очень надеюсь, что в ближайшем обновлении будут исправлены все проблемы с TUnimDBLookupComboBox. Очень актуально. Поймите, из-за этого проект стоит уже полгода Quote Link to comment Share on other sites More sharing options...
x11 Posted December 16, 2020 Author Share Posted December 16, 2020 Проблема с RemoteQuery все еще актуальна. Quote Link to comment Share on other sites More sharing options...
x11 Posted May 27, 2021 Author Share Posted May 27, 2021 On 10/2/2020 at 1:34 PM, Sherzod said: Я проверю. Подскажите, я правильно понимаю, что неправильную работу механизма RemoteQuery разработчики исправлять не будут? Quote Link to comment Share on other sites More sharing options...
x11 Posted September 24, 2021 Author Share Posted September 24, 2021 On 10/2/2020 at 1:34 PM, Sherzod said: Я проверю. Проблема с RemoteQuery все еще актуальна 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 24, 2021 Share Posted September 24, 2021 On 7/27/2020 at 1:12 PM, x11 said: На форме есть много списков типа TnimDBLookupComboBox. Все они работают в режиме RemoteQuery, т.е.: RemoteQuery := True; RemoteQueryRetainResult := True; При загрузке формы нужно у некоторых списков указать значение по умолчанию, т.е. чтобы, когда форма откроется, у этих списков уже было что-то выбрано и заполнено поле KeyValue. Чтобы потом, это значение KeyValue считать при сохранении объекта в базу. Как это правильно сделать? Вот мой код (DoOnNewRecord вызывается в FormShow) TStrIntPair = record key: integer; val: string; end; ... ... procedure TfmmForm1.DoOnNewRecord; Var StrIntPair: TStrIntPair; begin // валюта по умолчанию StrIntPair := UniMainModule.GetDefaultCarrency; OutputDebugString(PWideChar(StrIntPair.val)); if StrIntPair.key <> 0 then begin comboCurr.Items.Add(StrIntPair.val); comboCurr.KeyValue := StrIntPair.key; comboCurr.Text := StrIntPair.val; comboCurr.ItemIndex := 0; end; end; В отладчике вижу, что структура StrIntPair заполнена. Например, StrIntPair.key имеет значение 2. Но после открытия формы список пустой и валюта не выбрана. На снимке видно, что ничего не выбрано, а слово "валюта" - это placeholder (EmptyText). Ответ на первоначальный вопрос!? Quote Link to comment Share on other sites More sharing options...
x11 Posted September 24, 2021 Author Share Posted September 24, 2021 7 minutes ago, Sherzod said: Ответ на первоначальный вопрос!? Не совсем понял. Это вы спрашиваете или вы утверждаете, что это есть ответ на мой вопрос? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 24, 2021 Share Posted September 24, 2021 Спрашиваю. Quote Link to comment Share on other sites More sharing options...
x11 Posted September 24, 2021 Author Share Posted September 24, 2021 http://forums.unigui.com/index.php?/topic/14857-программно-заполнить-unimdblookupcombobox-и-выбрать-значение/&tab=comments#comment-81299 в бэкэнд не возвращается выбранное значение keyvalue Quote Link to comment Share on other sites More sharing options...
x11 Posted September 24, 2021 Author Share Posted September 24, 2021 Как вариант, можно сделать очередной костыль в виде выпадающей панели, на которой будет находиться uniDBGrid с данными (Колонки ID + NAME). Но, как правильно сделать, чтобы панель выпадала рядом с кнопкой, как будто это обычный список и пряталась? 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.