OlegK

Forum Replies Created

Viewing 15 replies - 706 through 720 (of 968 total)
  • Author
    Replies
  • in reply to: Height of toobar seach row #96158
    OlegK
    Participant

    If I read “please help” and know the solution it is difficult keep the silent. So I made a small demo. It shows how one use

    $(“thead > tr.ui-search-toolbar”, $(“#list”).hDiv).height(60);

    to set the heigth of the search toolbar to 60 pixels. In the way you can also modify the size of elements inside of the toolbar. You can do this on cause only if the toolbar exist. See a small trick with setTimeout in my demo. I hope it will save your time (no a week more).

    Best regards
    Oleg

    in reply to: Question about Date Formatter Masks #96157
    OlegK
    Participant

    Not a problem Chris! Nobody is perfect, also in searching… The most importent that your problem is solved. You welcome!

    Best regards
    Oleg

    in reply to: Page number still incremented when returning stop in onPaging #96155
    OlegK
    Participant

    Hello Tony!

    I could confirm the bug. We discussed it with Marcus in http://stackoverflow.com/questions/3805832/jqgrid-prevent-pager-navigation/3806072#3806072. The problem exist in some places in jqgrid.base.js where clearVals are used. Because onPaging called inside of clearVals can stop paging some things run incorrect now. For example if one onPaging return 'stop' why should be selection removed? (see inside of clearVals) Or look at 1740 and 1741:

    ts.p.page = ($(this).val()>0) ? $(this).val():ts.p.page;

    if(!clearVals('user')) { return false; }

    Ot 'stop' the pager will be changed, what is incorrect. The same problem exist in the lines 1692-1696 in the 'change' handle which for the select box of rowNum. One should verify all places of the usage of clearVals.

    It seems to me that one should call onPaging at the begining and then if it not stop paging then do the rest.

    Best regards
    Oleg

    in reply to: Paging, Sorting and appending with Local Data #96148
    OlegK
    Participant

    You can use addRowData

    in reply to: Paging, Sorting and appending with Local Data #96146
    OlegK
    Participant

    You can use addRowData method.

    Best regards
    Oleg

    in reply to: NaN as total number of pages for JSON/XML data with 0 rows #96131
    OlegK
    Participant

    Hello Tony,

    You are right, this is a workaround. In the question which initialized my post here it was used as a solution. I posted this problem here because I look at the problem from a little other side.

    It seems to me the problem which appears once will appear next time for other users. It would be better if one make jqGrid code a little more robust in case of missing some input information. I mean that it would be nice if jqGrid be able to display empty table not only for

    {“page”:1, “records”:0, “total”:1, rows:[]}

    but also for

    {“page”:1, “records”:0, “total”:1}

    {“page”:0, “records”:0, “total”:0}

    {“records”:0}

    or

    {}

    The most part of codes use already default values for missing input parameters. For example you use

    in reply to: grouping data will be displayed unformatted #96130
    OlegK
    Participant

    Hello Tony!

    I mean don't use autodetect of column type. I am not sure that it is possible in the general case.

    I suppose that the usage of sorttype for sorting of grouping column is the best way. It is mostly close to the rest concept of local sorting in jqGrid and make full power of sorting working without writing a lot of additional code. More sofisticated types of sorting like the usage of index defined as function of sorttype defined as function will be also automatic work.

    The formatting of group header row (the data from the groupText) seems me good to make in the same way as the formating of data in the corresponding column. Then one can really use the option groupColumnShow : [false] without missing a information. More sofisticated type of formating like will be also automatic work.

    Thanks and best regards
    Oleg

    in reply to: Question about Date Formatter Masks #96123
    OlegK
    Participant

    Hello Chris

    If you search in the forum for two words 'date' and 'mask' you will find this and this answers. There shows how you can use the mask.

    Regards
    Oleg

    OlegK
    Participant

    It seems to me that it is a new question. Nevertheless…

    Nothing is impossible. But some things are a little tricky. What do you asked for can be realized outside of jqGrid (as external filters) very easy. The realisation of the same scenario inside of jqGrid is do possible but a little tricky. One can define use dataEvents property of editoptions and define 'change' custom event handle. In the handle you can make an ajax request to the server (I recommend you include caching of this ajax request, because information about coutries will be changed not so friquently) and then rebuild element of the secton column.

    You can searach the forum for the corresponding examples. For example here you will find discussion and examples on the subject.

    Best regards
    Oleg

    in reply to: Custom dialog to add row #96111
    OlegK
    Participant

    Hello Deepak,

    You can use addRowData.

    Best regards
    Oleg

    OlegK
    Participant

    Hello Vivaldi!

    1) If you use mtype: 'GET' the values from postData will be just concatinated to the value of url parameter of jqGrid. To be exactly the values will be encoded with respect of encodeURIComponent function. Before concatianting postData value to url will be verified whether url already contain '?' in not yet then the '?' will be inserten between url and converted postData. If '?' alreasdy exist, then '&' will be used like between on different properties of postData. For example if url:'/myDataProvider' and postData: {city:”New York”,regionId:2} then the destination url will be '/myDataProvider?city=New+York&regionId=2'. So it is very easy in use.

    Morover if postData: {city:function() { return $(“#country option:selected”).val(); },regionId:2} then on every reload of data will be get the current selected value from the drop-down list with id=”contry” (# selector mean 'id' and not 'name' attribute): '…'

    2) you should better never use event handle like “onchange” direct in HTML code: ''; It is every old style, it has many disadvantages. For example myReload() funtion must be global which is bad because of different reasons.

    OlegK
    Participant

    Hi!

    Now I understand you problem. It can be very easy implemented with respect of jqGrid. Look at my old answer on the stackoverflow.com.

    You should define 'change' event handler on the select html element with contries and call trigger('reloadGrid') on your jqGrid to refresh the data on any select of net contry. Moreover, you can send in all requests to the server the curent value selected in the 'country' select element. To do this you can use postData with functions as the value of some properties. I recommend you also insert in all select lists like 'country' the option with the text 'All' and the empty value. This option could be default. This will allows to get unfiltered data.

    You can also use filterToolbar to implement the same bevavior inside of jqGrid. I prefere to use stringResult:true option additionally to stay compatible with the advanced searching.

    How you can see jqGrid is very flexible and allow you impelment different scenarios.

    Best regards
    Oleg

    in reply to: Case insensitive wildcard filter with filterToolbar #96091
    OlegK
    Participant

    Look at my answer here

    OlegK
    Participant

    Hello Vivaldi,

    In my opinion you do can use jqGrid to implement dynamic table. But loading of current data from the server on every row select or cell select I find not good. The developer of jqGrid found this also not good and not implemented this kind of “dynamic tables” in the jqGrid. The reason is easy to explain. If you do so, and a some row before selected row is inserted then the selected row must be one row below after the data refresh. This behavior will make the user

    in reply to: grouping of XML/JSON data with repeatitems:false in the reader #96086
    OlegK
    Participant
Viewing 15 replies - 706 through 720 (of 968 total)

Stay connected with us in your favorite flavor!