Forum Replies Created

Viewing 15 posts - 1 through 15 (of 144 total)
  • Author
    Posts

  • walker1234
    Participant

    Thanks Yavor. Few more questions:

    1. When I select something where Start Year is greater than End Year, I can see the error message which is good. Once I select End Year value greater than Start Year, I can see the message getting disappear, which is good as well. However, I noticed there is a left over of the message in a downward arrow form in the UI, as shown in the image below. Is it possible to get rid of that?

    2. while printing the selectedRows in console, I see some additional unwanted parameters showing up in the console.log as explained below:

    I added a console.log in this JSfiddle:

    https://jsfiddle.net/walker123/1r83zk0x/3/

    ` console.log(“Testing additional parameters in console.log”);
    console.log(selectedRows);`

    And got the following in console.log after selecting a row:

    “Testing additional parameters in console.log”

    [{
      available: true,
      boundindex: 0,
      endyearValue: "2021",
      firstname: "Yoshi",
      lastname: "Nagase",
      price: 2.5,
      productname: "Caffe Americano",
      quantity: 10,
      startyearValue: "2015",
      total: 25,
      uid: 0,
      uniqueid: "2918-19-30-24-302718",
      visibleindex: 0,
      yeareligible: "Y"
    }]

    I am wondering what are these additional parameters in above object?

    uniqueid: "2918-19-30-24-302718",
      visibleindex: 0,  boundindex: 0,

    Is it possible to get rid of these?

    Thanks,
    Walker1234


    walker1234
    Participant

    Thanks Yavor. JSFiddle looks good : https://jsfiddle.net/ptdm4qza/2/

    Few more quick questions:

    1. Is it possible to disable the Get Rows button until user selects at least one row? And as soon as they checkmark at least one row, it should be enabled.

    2. After user hits Get Rows button, what method can be used to clear the existing selection? For example, if a user has selected two rows and then hits the Get Rows button, then if. auser accidently hits the same button again , they will submit same selected rows again. So I don’t want this to happen and clear the selection after they hit the Get Rows button.

    Thanks,
    Walker1234


    walker1234
    Participant

    Hi Yavor,

    Thanks, I think there was some confusion while answering my last question. My main question is regarding the dates. Please find my question below:

    I am wondering if we can make sure that before user hits the Get Rows button, if it is possible to make sure that the Start Year is always less than End Year ? For example, I want to display an error message if the user selects Start Year as 2020 and End Year as 2012 and doesn’t want user to click Get Rows button in that case.

    https://jsfiddle.net/walker123/pxb3jLvw/93/

    Please take a look.

    Thanks,
    Walker1234


    walker1234
    Participant

    Hi Yavor,

    Thanks for your inputs.

    I have modified JSFiddle to include two date column Start Year and End Year. I am wondering if there is any JQXDropdownlist way of making sure that before user hits the Get Rows button, if it is possible to make sure that the Start Year is always less than End Year ? For example, I want to display an error message if user selects Start Year as 2020 and End Year as 2012 and doesn’t want user to click Get Rows button in that case.

    My updated JSFiddle is below:

    https://jsfiddle.net/walker123/pxb3jLvw/93/

    Brief Update on my requirements:
    My requirements changed a little bit so I am no longer validating if user doesn’t select anything for the dates column but I am sending default date values if a user check marks a row with year Eligible column as Y . I am sending 2015 as default start year and 2021 as default end year. Also, in addition to adding two dates colums I have removed the last name column for brevity.

    Thanks,
    walker1234

    • This reply was modified 1 week, 3 days ago by  walker1234.
    • This reply was modified 1 week, 3 days ago by  walker1234.

    walker1234
    Participant

    Thanks Yavor,

    Quick questions after looking at your JS Fiddle – https://jsfiddle.net/hme3wnts/:

    1. I can see that clicking Get rows method is showing Invalid Value if date is not selected. Do you think that it’s possible to show this only for checked rows and not for all other rows with Year Eligible as Y? I mean right now, it is showing Invalid Value for those rows as well for which I didn’t select the check box.

    2. Is it possible to show some different customized message instead of Invalid Value ? Like – Please select a year for your selected row

    Thanks,
    Walker1234

    • This reply was modified 1 week, 6 days ago by  walker1234.

    walker1234
    Participant

    Hi Yavor,

    I tried putting your validation code in the JSFiddle, and for some reason, it doesn’t seem to be working (button is not hidden and upon clicking the button it’s not doing any validation). Here is the modified JSFiddle with your code: https://jsfiddle.net/rk9085pt/

    Please let me know if I am missing anything here?

    Thanks,
    walker1234


    walker1234
    Participant

    Hi Yavor,

    Excellent. That works. One quick question – Do you think I can force user to select the dates if they haven’t for the cells where we have jqxDropdownlist available?

    Like when they click on Get Rows button, I want to validate whether they have selected a year from the dropdown list or not and if they haven’t , then I should not allow them to click Get rows button, maybe.

    Thanks


    walker1234
    Participant

    Hi Yavor,

    Thanks. Your approach works fine when I click on the Get rows button and I can see it working in this JSFiddle and it shows like this:

    However, I would like to clarify my requirement. Sorry if I wasn’t clear enough in my earlier posts.

    1. I want to display N/A when the jqxgrid loads and not when I click on Get rows button. So, basically, just like it is displaying in the image above, I want to display exactly the same when the grid loads for the first time. I tried moving the logic outside $('#jqxbutton').click(function () { function but it didn’t work. I am wondering if something needs to happen inside createeditor function?

    2. For cell values where we have yearEligible = N, can we just disable the jqxDropdownlist completely and display N/A as explained in point #1 above as soon as the grid loads/initializes?


    walker1234
    Participant

    Hi Yavor,

    The following code did what I was looking for as far as my question 1 is concerned from my original post. :

    for(let i = 0; i < selectedRows.length; i++) {
            
         if(selectedRows[i].yeareligible === "N" && selectedRows[i].yearValue === undefined) {
              selectedRows[i].yearValue = '-1';
          }
                      
    
      }

    As far as my second question is concerned:

    Display N/A on the cell under Year column for which the Year Eligible column has a value of N?

    I want to display N/A on the grid if the Year Eligible column has a value of N. Any idea, how can I achieve this?


    walker1234
    Participant

    Hi,

    I didn’t quite get what you were trying to do. I tried to apply your stuff in my JS Fiddle which looks somewhat like this : https://jsfiddle.net/walker123/peguh5rt/35/

    Please take a look.

    It looks like you added a separate dropdown for the year.

    I am looking for displaying the year dropdown in the grid which is hiding at the moment unless you click on the cell.


    walker1234
    Participant

    Hi Martin,

    Can you take a look at this JS Fiddle?

    http://jsfiddle.net/es19w7cx/3/

    I modified the one you shared and added a button there. The getrows method is working fine and I can see the array in console.log. However, I am not sure how can I filter it based on the selection of item? Basically, not sure how to filter it by the datafield of the checkbox column. Please take a look.

    Thanks


    walker1234
    Participant

    Thanks Martin.

    How do I get the information related to the only selected items from that table when a user hits a Submit button? I was thinking to have a JSON Object of all the selected information. Is there a property in jQXgrid to do this?


    walker1234
    Participant

    I am already using my server URL and it’s generating empty file. Please read my questions again carefully and answer.

    in reply to: Search functionality Search functionality #107894

    walker1234
    Participant

    Hello Hristo,

    Thanks. I will look into your solution and will answer your question soon. Before that, I have one more question.

    Whatever search is happening in Filtering–>Filter Row section of this demo:

    https://www.jqwidgets.com/react/react-grid/index.htm#https://www.jqwidgets.com/react/react-grid/react-grid-filterrow.htm

    And whatever search criteria it has like contains,contains(match case), not empty etc, if I want to have a call to webservice when a user selects these options , is it possible to do so? Right now it’s your javascript code which is handling it without any server side calls.

    Thanks

    in reply to: Search functionality Search functionality #107854

    walker1234
    Participant

    What is the relation with the onSort option (is this the event)?

    It’s referring to a function as described below:

    onSort={this.gridOnSort}

    And gridOnSort function is defined as follows:

    private gridOnSort(event: any): void {
            const sortinformation = event.args.sortinformation;
            let sortdirection = sortinformation.sortdirection.ascending ? 'ascending' : 'descending';
            if (!sortinformation.sortdirection.ascending && !sortinformation.sortdirection.descending) {
                sortdirection = 'null';
            }
            this.myGrid.current.updatebounddata('sort')
        };

    I tried to search updatefilterconditions and createfilterwidget property in the API documentation page you mentioned (https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm?search=grid)

    Could you help me find it?

    Thanks

Viewing 15 posts - 1 through 15 (of 144 total)