Sherzod Posted February 8, 2022 Share Posted February 8, 2022 На серверной стороне. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 8, 2022 Author Share Posted February 8, 2022 4 minutes ago, Sherzod said: На серверной стороне. Ок. Вот я сделал Триггер (Очистить цвет) и обрабатываю его: procedure TfmmEditObjectParent.comboColorAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin inherited; if EventName = 'trgclick' then if Params.Values['id'] = '0' then begin fObjColor := 0; comboColor.ItemIndex := comboColor.Items.IndexOfObject(pointer(0));// clBlack или clNull end; end; Цвет остается старый. На смартфоне та же проблема. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2022 Share Posted February 8, 2022 On 2/7/2022 at 3:04 PM, x11 said: procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UnimComboBox1.JSInterface.JSCode(#1'.setValue(Object.keys('#1'.colors)['+ UnimComboBox1.items.IndexOfObject(Pointer(clLime)).ToString() +']);') end; ? Quote Link to comment Share on other sites More sharing options...
x11 Posted February 8, 2022 Author Share Posted February 8, 2022 Аааа, точно, я про эту строку и забыл. Спасибо, что напомнили 👍 так работает Quote Link to comment Share on other sites More sharing options...
x11 Posted February 8, 2022 Author Share Posted February 8, 2022 On 2/3/2022 at 1:25 PM, Sherzod said: comboColor.JSInterface.JSCall('setSelection', [comboColor.items.IndexOfObject(Pointer(color))]); Вопрос по десктопному варианту. При открытии формы не отрисовывается цветной прямоугольник. procedure TfrdEditObject.SelectColorInCombo(AColor: TColor); begin comboColor.ItemIndex := comboColor.items.IndexOfObject(Pointer(AColor)); comboColor.JSInterface.JSCall('setSelection', [comboColor.items.IndexOfObject(Pointer(Acolor))]); end; Я пробовал обе строки подставлять, выбор есть, а цвет не виден. Спасибо. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 10, 2022 Author Share Posted February 10, 2022 up Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 10, 2022 Share Posted February 10, 2022 On 2/8/2022 at 5:54 PM, x11 said: При открытии формы не отрисовывается цветной прямоугольник. Just now, x11 said: up Testcase please or steps to reproduce. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 10, 2022 Author Share Posted February 10, 2022 Странно, в тестовом проекте работает, а в боевом проекте - нет Пытаюсь найти проблему. Quote Link to comment Share on other sites More sharing options...
x11 Posted February 10, 2022 Author Share Posted February 10, 2022 В общем, проблема из-за фреймов. Т.к. в боевом проекте я использую - фреймы, а в тестовом - формы. Поэтому при использовании фреймов нужно строку comboColor.JSInterface.JSCall('setSelection', [comboColor.items.IndexOfObject(Pointer(clLime))]); перенести из UniFrame.OnCreate в UniFrame.OnReady 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.