OlegTimkiv Posted January 29, 2022 Share Posted January 29, 2022 Добрый день! Подскажите пожалуйста, как можно получить значение родительской ветки? grid.ClientEvents.ExtEvents.Values['beforeselect'] := 'function beforeselect(sender, record, index, eOpts){'+ UniComboBox1.JSName + '.setValue(record.childNodes[0].Text)'+ '}'; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 Здравствуйте, 3 minutes ago, OlegTimkiv said: grid.ClientEvents.ExtEvents.Values['beforeselect'] := 'function beforeselect(sender, record, index, eOpts){'+ UniComboBox1.JSName + '.setValue(record.childNodes[0].Text)'+ '}'; А что делает этот код? Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 Just now, Sherzod said: Здравствуйте, А что делает этот код? При выделении записей в треегриде, пытаюсь получить значение родительского узла и установить в комбобокс. " record.childNodes[0].Text " - Псевдокод, в мануалах extJS не могу найти какие там свойства должны быть. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 record.parentNode.data[0] Если нет, то получите undefined. Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 5 minutes ago, Sherzod said: record.parentNode.data[0] Если нет, то получите undefined. Спасибо, работает с дочерними узлами, подскажите а можно с родительскими? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 1 minute ago, OlegTimkiv said: подскажите а можно с родительскими? А что там должно быть, у этого же узла нет родителя!? Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 7 minutes ago, Sherzod said: А что там должно быть, у этого же узла нет родителя!? Этот узел являться родительским. При нажатии на него отображаем наименование узла в комбобоксе. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 Just now, OlegTimkiv said: Этот узел являться родительским. При нажатии на него отображаем наименование узла в комбобоксе. Пожалуйста, приведите несколько примеров... Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 4 minutes ago, Sherzod said: Пожалуйста, приведите несколько примеров... TestTreeGrid.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 Я имел в виду, примеры выделения узлов, и что должно быть получено... Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 9 minutes ago, Sherzod said: Я имел в виду, примеры выделения узлов, и что должно быть получено... В комбобоксе хранятся наименования всех родительских узлов, при выделение родительских узлов в треегриде, наименование подгружаться в комбобокс. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Share Posted January 29, 2022 9 minutes ago, OlegTimkiv said: Тогда просто используйте record.data[0] function beforeselect(sender, record, index, eOpts) { if (record.hasChildNodes()) { //record.data[0] } } 1 Quote Link to comment Share on other sites More sharing options...
OlegTimkiv Posted January 29, 2022 Author Share Posted January 29, 2022 3 minutes ago, Sherzod said: Тогда просто используйте record.data[0] function beforeselect(sender, record, index, eOpts) { if (record.hasChildNodes()) { //record.data[0] } } Большое спасибо!!! 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.