Jump to content

boka

uniGUI Subscriber
  • Posts

    27
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

Recent Profile Visitors

575 profile views

boka's Achievements

Newbie

Newbie (1/4)

1

Reputation

  1. +1 @VolkovVitalD, got any decision?
  2. Вопрос практический такой же, как в последних постах тут Поясню свой: Есть DBLookupCombo c заполненными только ListSource, KeyField и ListName. DataSet под ListSource является master в Master-Detail relation, cоответственно, при выборе нового значения в DBLookupComboBox перезапрашивается detail dataset. Всё бы хорошо, но если в detail dataset накопились изменения при CachedUpdates, то их желательно записать в БД, выполнив ApplyUpdates и предварительно спросив, а стоит ли их сохранять. EnableSynchronousOperations = true и запрос MessageDlg обязательно должен быть блокирующим, иначе [ListSource.DataSet.]KeyField успевает поменяться на новый и закэшированные в detail dataset изменения сбрасываются. Пытался поднимать MessageDlg и в TUniDBLookupCombo.OnChange, и в ~.OnChangeValue (само собой в OnSelect, OnExit и OnCloseUp уже поздно), и в [ListSource.DataSet.]KeyField.OnChange, но получаю "Dataset Blocking method MessageDlg() can not be called here". Где-то в ClientEvents я успею перехватить контроль в самом начале, когда ещё можно?
  3. DBG.RefreshCurrentRow solves the problem w/o JS and catching grid events.
  4. Yep, much closer, thanx @Sherzod Changed code a bit but on the repeat attempt it keeps the last used Cell in an edit state. I tried both methods to finish editing but did not succeed. function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns.forEach(function(col) { if (col.getEditor().xtype == "combo") { col.getEditor().on('select', function(combo) { Ext.defer(function() { var _row = sender.getStore().indexOf(sender.getSelection()[0]); if (col.dataIndex === '1' && combo.getValue() === 'Min-Max') { var _colIndx = 2; sender.editingPlugin.startEditByPosition({ row: _row, column: _colIndx }); sender.getColumns()[_colIndx].getEditor().setValue(null); sender.editingPlugin.completeEdit; //1st _colIndx = 3; sender.editingPlugin.startEditByPosition({ row: _row, column: _colIndx }); sender.getColumns()[_colIndx].getEditor().setValue(null); sender.editingPlugin.completeEdit; } else if (col.dataIndex === '1' && combo.getValue() != 'Min-Max') { var _colIndx = 4; sender.editingPlugin.startEditByPosition({ row: _row, column: _colIndx }); sender.getColumns()[_colIndx].getEditor().setValue(null); sender.editingPlugin.editing = false; // 2nd } }, 0) }) } }) }
  5. Like in normal use - eihter when pressing corresponding Navigator button or it posts automatically when changing a row. I don't want to change common user/UI behavior.
  6. Thanks, @Sherzod Ok, now I catch that fired AJAXEvent and get those necessary cells clear before Post already! But! The combobox (without Post) turns back to the initial value every time! And even though it was already in changed state! if EventName = 'comboSelected' then begin var DS := (Sender as TUniDBGrid).DataSource.DataSet; if not (DS.State in dsEditModes) then DS.Edit; if DS.FieldByName('METHOD_NAME').Value = 'Min-Max' then begin DS.FieldByName('LOOKUP_DEPTH').Value := null; DS.FieldByName('METHOD_TYPE').Value := 'MM'; DS.FieldByName('METHOD_NAME').Value := 'Min-Max' end else begin DS.FieldByName('LEFTOVER_MIN').Value := null; DS.FieldByName('METHOD_TYPE').Value := 'AV'; DS.FieldByName('METHOD_NAME').Value := 'по среднему'; end; // Post; end; As you see I even tried to reassign it's value. P.S. I don't want to Post changes without need.
  7. As far as I understand this event fires when the AField changes. Ok, now I hook the changes of that dropdown field in OnSetCellValue on Form (Previously was in OnChange event in DataModule). But in OnSetCellValue the underlying DataSet is in dsBrowse state that makes me turn it into Edit state first, then change the necessary fields values and Post them after all because only after DataSet.Post I see the refreshed data in DBGrid. And is there any way to refresh the DBGrid/Row/Cell representation without posting? I just want to see/make the empty cell 'Остаток min' immediately right after changing 'Min-Max' selected above onto 'по среднему' (there are only two values)
  8. nope, plain data fields. I execute that code from a DataModule if it matters 'cause haven't found how to catch the dropdown closing event from a Form
  9. When choosing first value 'по среднему' from dropdown list I want to clear value from cell 'Остаток min' in that row, when choosing 'Min-Max' - from 'Глубина анализа'. Just to see them empty. As it seen in my example I do it with the data of corresponding dataset fields (in OnChange event of underlying 'dropdown' TField) but that doesn't lead to the DBGrid representation
  10. I have a lookup db field among different others in my connected TxxQuery and I want to clear some of them on DBGrid right after choosing the value from dropdown, when it is already collapsed. Assigning nulls on "data" level doesn't work IsMinMax := SameText(qDemandSettingsMETHOD_TYPE.Value, 'MM'); if IsMinMax then qDemandSettingsLOOKUP_DEPTH.AsVariant := null else qDemandSettingsLEFTOVER_MIN.AsVariant := null; [METHOD_TYPE is that "lookup" field, LOOKUP_DEPTH and LEFTOVER_MIN - those I need to clear in DBGrid] Do I need to do something on client side or somehow force to refresh the grid?
×
×
  • Create New...