List View

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krishnapriya
    Senior Member
    • Aug 2017
    • 209

    List View

    Hello,

    In quotes, I have one boolean field master.
    I want to display in list view, only those quotes with master=1.


    I tried like this in list.js-> buildRow


    if (model.name == 'Quote') {
    if (model.get("master") == 1) {
    this.rowList.push(key);
    this.getInternalLayout(function (internalLayout) {
    internalLayout = Espo.Utils.cloneDeep(internalLayout);
    this.prepareInternalLayout(internalLayout, model);
    this.createView(key, 'views/base', {
    model: model,
    acl: {
    edit: this.getAcl().checkModel(model, 'edit')
    },
    el: this.options.el + ' .list-row[data-id="' + key + '"]',
    optionsToPass: ['acl'],
    noCache: true,
    _layout: {
    type: this._internalLayoutType,
    layout: internalLayout
    },
    name: this.type + '-' + model.name
    }, callback);


    }.bind(this), model);

    }
    else {
    callback();
    }
    }

    It is working,but the number of rows is not correct.

    Or any other way is there other than filter.

    Thanks in advance.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Because this you need to do on the backend. Create a primary filter and load the data by filter. (Like onlyMy, or only Published Articles for Portal Users )

    Comment

    • krishnapriya
      Senior Member
      • Aug 2017
      • 209

      #3
      But what if the value of master is any X? Like we cannot predict the value before. It can be any value.

      How can I achieve this filter?

      Is there any way to pass a mysql query to the filter?

      Please help.
      Last edited by krishnapriya; 03-06-2018, 07:47 AM.

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        your field is boolean. How it could be any?

        Comment

        • krishnapriya
          Senior Member
          • Aug 2017
          • 209

          #5
          Hi Tanya, Am sorry , I got it working for boolean field as you guided me here.

          But for a varchar field how can I search with the dynamic value. This is what I meant.

          Thanks Tanya,

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Primary filters couldn't be dynamic. Only defined. As enum status field for Case or stage field for Opportunity

            Comment


            • krishnapriya
              krishnapriya commented
              Editing a comment
              Ok Tanya. Thank you :-)
          Working...