Jump to content

MultiSelect/мультивыбор в виде списка ID+Name


x11

Recommended Posts

да, я пытался добавить к стилю " background: gray;", но безуспешно

function afterCreate(sender)
{
  var done = new Ext.Button({
        text: 'OK',
        renderTo: sender.getPicker(),
        style: 'position: absolute; bottom: 0px; width: 100%; background: gray;'
    });
    
   sender.getSelIds = function(sender) {
        let Ids = "";
        if (sender.getSelection() == null) return "";
        sender.getSelection().forEach(function(item) {
            Ids += item.id + ","
        });
        return Ids.slice(0, -1);
    };
    
}

т.е. проблема только в двух указанных темах

Link to comment
Share on other sites

52 minutes ago, x11 said:

Screenshot_16.jpg

Кажется, Вы должны менять здесь:

procedure TMainmForm.InitSelect;
begin
  FillSelect;
  UnimSelect1.JSInterface.JSConfig('multiSelect', [True]);
  UnimSelect1.JSInterface.JSAddListener('painted', 'function(me){if (me.getValue()) {me.setPlaceholder()} else {me.setPlaceholder(me._placeHolder)}}');
  UnimSelect1.JSInterface.JSAddListener('change', 'function(me){if (me.getValue()) {me.setPlaceholder()} else {me.setPlaceholder(me._placeHolder)} ajaxRequest('+ Self.WebForm.JSName +', "selEvents", ["objName="+me.uname, "values="+me.getValue(), "selIds="+me.getSelIds(me)])}');

  UnimSelect1.ClientEvents.UniEvents.Values['afterCreate'] :=

    'function afterCreate(sender) ' +
    .....

 

Link to comment
Share on other sites

  • 2 weeks later...

Хорошо, если бы в заголовках тем был чекбокс, что проблема решена, чтобы можно было видеть/искать нерешенные проблемы.

Чтоб можно было видеть в списке тем, что тот или иной вопрос уже решен.

Link to comment
Share on other sites

  • 4 months later...

Подскажите, как то же самое проделать для десктопа с фреймом?

этот код для мобильной версии:

procedure TfmmParentEditObject.InitPrm;
begin
  FillPrm;//наполняю список
  selPrm.JSInterface.JSConfig(constMultiSelect, [True]);
  selPrm.JSInterface.JSConfig('valueField', ['id']);
  selPrm.JSInterface.JSAddListener(constPainted, funcPlaceholderPained);
  selPrm.JSInterface.JSAddListener('change', 'function(me){if (me.getValue()) {me.setPlaceholder()} else {me.setPlaceholder(me._placeHolder)} ajaxRequest('+ Self.WebForm.JSName +', "selEvents", ["objName="+me.uname, "values="+me.getValue(), "selIds="+me.getSelIds(me)])}');

  selPrm.ClientEvents.UniEvents.Values[constAfterCreate] :=

    'function afterCreate(sender) ' +
    '{' +
    '  var done = new Ext.Button({' +
    '        text: ''OK'',' +
    '        renderTo: sender.getPicker(),' +
    '        style: ''position: absolute; bottom: 0px; width: 100%; background-color: gray;''' +
    '    });' +
    '   sender.getSelIds = function(sender) {' +
    '        let Ids = "";' +
    '        if (sender.getSelection() == null) return "";' +
    '        sender.getSelection().forEach(function(item) {' +
    '            Ids += item.id + ","' +
    '        });' +
    '        return Ids.slice(0, -1);' +
    '    };' +
    '    createToolTip(sender, ' + QuotedStr(StrToJS(constPrm)) + '); ' +
    '}';
end;

Сейчас ругается на Self.WebForm.JSName

 

Link to comment
Share on other sites

Мне нужен мультивыбор с ID и Name, как это вы мне подсказали для мобильной версии TunimSelect. Только теперь для для десктопа на базе фрейма.

Заполнить UniCheckComboBox у меня получается, а как программно поставить галочку у конкретных ID и как потом считать те отмеченные пользователем пункты опять же по ID

Link to comment
Share on other sites

2 hours ago, x11 said:

ajaxRequest('+ Self.WebForm.JSName +', "selEvents",

посмотрите свой пример, пожалуйста, может его можно преобразовать к использованию для фрейма и десктопа?

Link to comment
Share on other sites

procedure TfrdParentEditObj.InitPrm;
begin
  FillPrm;
  //comboPrm.JSInterface.JSConfig(constMultiSelect, [True]);
  comboPrm.JSInterface.JSConfig('valueField', ['id']);
//  comboPrm.JSInterface.JSAddListener(constPainted, funcPlaceholderPained);
  comboPrm.JSInterface.JSAddListener('change', 'function(me){ ajaxRequest('+ fmMain.WebForm.JSName +', "selEvents", ["objName="+me.uname, "values="+me.getValue(), "selIds="+me.getSelIds(me)])}');

  comboPrm.ClientEvents.UniEvents.Values[constAfterCreate] :=

    'function afterCreate(sender) ' +
    '{' +
//    '  var done = new Ext.Button({' +
//    '        text: ''OK'',' +
//    '        renderTo: sender.getPicker(),' +
//    '        style: ''position: absolute; bottom: 0px; width: 100%; background-color: gray;''' +
//    '    });' +
    '   sender.getSelIds = function(sender) {' +
    '        let Ids = "";' +
    '        if (sender.getSelection() == null) return "";' +
    '        sender.getSelection().forEach(function(item) {' +
    '            Ids += item.id + ","' +
    '        });' +
    '        return Ids.slice(0, -1);' +
    '    };' +
    '}';
end;

вот такая ошибка

помогите исправить

спасибо

Screenshot_5.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...