Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - suvalkon

Pages: [1]
1
Help for ParamQuery Pro / Re: Detail window now shows no height
« on: September 14, 2014, 03:20:47 am »
It was working with tabs in the first instance and I need to get it working with different tabs for what is needed with different information for each job#.
I have tried to run without bootstrap and none of the css files have changed( I checked the file dates) but it makes no difference.
Is it because there is no vertical scroll bar on the primary grid?
I have tried to make one but can't get it to do it?

Here is the cshtml file details.

<!DOCTYPE html>
<html>
<head>
     <meta charset="utf-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="description" content="Mainstream Freight specialising in Shipping, Logistics and Containers"/>
<!--     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> -->
    <title>
         My Mainstream
      </title>
    <link rel="stylesheet" href="resources/css/redmond/jquery-ui-1.10.4.custom.min.css" type="text/css" media="all" />
<!--      <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/redmond/jquery-ui.css" /> -->
<!--     <link rel="stylesheet" href="resources/css/webstyle.css" type="text/css" media="all" /> -->
<!--      <link rel="stylesheet" href="resources/css/base.css" type="text/css" media="all"> -->
      <!--PQ Grid files-->
      <link rel="stylesheet" href="resources/paramquery-2.1.0/pqgrid.min.css" type="text/css" media="all" />
      <!--PQ Grid Office theme-->
      <link rel="stylesheet" href="resources/paramquery-2.1.0/themes/office/pqgrid.css" type="text/css" media="all" />
      <link href="/resources/css/bootstrap.css" rel="stylesheet"/>
     <script src="resources/javascript/jquery-1.11.0.min.js" type="text/javascript"></script>
<!--      <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> -->
     <script src="resources/javascript/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>
   <!-- <script src="resources/javascript/jQuery.XDomainRequest.js?v=2" type="text/javascript"></script>-->

<!--      <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> -->
<script src="resources/paramquery-2.1.0/pqgrid.min.js" type="text/javascript"></script>
   <script src="resources/javascript/moment.js" type="text/javascript"></script>
   <script src="/resources/javascript/bootstrap.min.js"></script>
<!--    <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> -->
  <!-- <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> -->
  <script type="text/javascript" src="resources/timepicker/jquery.timepicker.js"></script>
       <link rel="stylesheet" type="text/css" href="resources/timepicker/jquery.timepicker.css" />
 

2
Help for ParamQuery Pro / Re: Detail window now shows no height
« on: September 11, 2014, 05:53:01 am »
The interesting thing by hitting F-12 debugger the window dispays (but not always). When the screen height is shortened sometimes it displays
See Attachment despatchjobs.pdf.
Some are opened OK and othesr not as you can see on the example.
If I take the debug away none of them open OK.

As you can see there are no debugger errors.
Datamodel is local so dataModel.error won't apply will it?

This behaviour started happening I think when I tried to fix the main grid with minWidth and show horizontal scroll so it could fit to the right of the Navigation menu.
(Again see attached example).

I have included the whole code for you to look at.
The <div> in the HTML is...

<div id="grid_array" style="margin: 10px;">
</div>
<!--script tag used to define detail template-->
<script id="tmpl" type="text/pq-template">
    <div class="pq-tabs" style="width:auto;">
        <ul>
            <li><a href="#tabs-1">Job Details</a></li>
         <!--<li><a href="#tabs-2">Replace Example</a></li>-->
        </ul>
        <div id="tabs-1">
        </div>
      <!-- THE FOLLOWING TAB WOULD BE A REPLACEMENT OF TAGS EXAMPLE -->
      <!--<div id="tabs-2">
            <p><b>Order Date:</b> <#=OrderDate#></p>
            <p><b>Required Date:</b> <#=RequiredDate#></p>
            <p><b>Shipped Date:</b> <#=ShippedDate#></p>
        </div>-->
    </div>
</script>





3
Trying to save Json into array crashes at the source. Have you any example which stores json successfully for use later as a variable?

4
Help for ParamQuery Pro / Re: Detail window now shows no height
« on: September 10, 2014, 10:51:14 am »
And I forgot here is a snippet of the JSON return after update.
The removeClass is above in the standard logic as in you demo in the update event.
See below code.
Are you saying not to do the remove class until you are sure what comes back from the JSON?

if (!isDirty) {
         var url,
            rowData = $Maingrid.pqGrid("getRowData", { rowIndx: rowIndx }),
            recIndx = $Maingrid.pqGrid("option", "dataModel.recIndx");

         $Maingrid.pqGrid("removeClass", { rowIndx: rowIndx, cls: 'pq-row-edit' });
         $Maingrid.pqGrid("showLoading");
.......
.......
.......

success: function (jdata) {
               var s1 = jdata.msg.msgSeverity,
                  s2 = jdata.msg.msgCust,
                  s3 = jdata.msg.msgMain;
               if (s1 == "F") {
                  //alert(s3);
                  // SHOW THE ERROR IN THE STANDARD ERROR MESSAGE AREA
                  errfmt = '<font color="red"><b>' + s3 + '</b><br></font>'
                  $("#msg").html(errfmt);
                  $Maingrid.pqGrid("rollback");
                  $Maingrid.pqGrid("refreshDataAndView");
                  $Maingrid.pqGrid("hideLoading");
               } else {
                  //console.log(s1 + " " + s3);
                  $Maingrid.pqGrid('option', 'dataModel.data', jdata.despjobdetout.djno);
                  $Maingrid.pqGrid("refreshDataAndView");
                  $Maingrid.pqGrid("hideLoading");
                  location.reload(true); //this reloads the whole page (nasty but the best we can do at this stage) !!!!!!!!!!!!!!!!!!!!!!!
                  //$("#grid_array").pqGrid("refreshRow", {rowInx: rowIndx} );
                  //$("#grid_array").pqGrid('option', 'dataModel.data', jdata.despjobdetout.djno);
                  //$("#grid_array").pqGrid("refreshDataAndView");
               }
               
               //delete button (if present)
               $Maingrid.find("button.delete_btn").button({ icons: { primary: 'ui-icon-close'} })
               .unbind("click")
               .bind("click", function (evt) {
                  if (isEditing($Maingrid)) {
                     return false;
                  }
                  var $tr = $(this).closest("tr"),
                     rowIndx = $Maingrid.pqGrid("getRowIndx", { $tr: $tr }).rowIndx;
                  MaindeleteRow(rowIndx, $Maingrid);
               });
               //edit button
               $Maingrid.find("button.edit_btn").button({ icons: { primary: 'ui-icon-pencil'} })
               .unbind("click")
               .bind("click", function (evt) {
                  if (MainisEditing($Maingrid)) {
                     return false;
                  }
                  var $tr = $(this).closest("tr"),
                     rowIndx = $Maingrid.pqGrid("getRowIndx", { $tr: $tr }).rowIndx;
                  MaineditRow(rowIndx, $Maingrid);
                  return false;
               });

5
Help for ParamQuery Pro / Re: Detail window now shows no height
« on: September 10, 2014, 10:41:35 am »
There are other properties after the width....
I have tried all combinations but can't understand why it just displays the heading and no detail.
It almost seems that it is due to some of the properties I have changed for the main grid.

flexHeight: true,
      resizable: true,
      sortable: false,
      editable: false,
        width: "auto",
      //height: 150,
        //autoSizeInterval: 500,
      track: true, //to turn on the track changes.
        numberCell: { show: false },
        showTop: false,
        showBottom: false,
      hoverMode: 'cell',

6
Help for ParamQuery Pro / Detail window now shows no height
« on: September 10, 2014, 07:32:55 am »
HI

All of a sudden my detail window has no height.
See following code as per example. It did show height at some stage but now I don't know what has made it come out with no height?

var gridDetailModel = {
      pageModel: { type: "local", rPP: 5, strRpp: "" },
      dataModel: {
            location: "local",
            sorting: "local"
        },
      colModel: [
            { title: "Job No.", width: 80, dataIndx: "jobNumber", editable: false },
         { title: "Truck No.", width: 40, dataType: "string", dataIndx: "drivercode", align: "center", editable: false },
         { title: "Truck Name", width: 100, dataType: "string", dataIndx: "driverName", align: "center", editable: false },
         { title: "Company Name", width: 150, dataType: "string", dataIndx: "companyName", align: "left", editable: false },
         { title: "Address", width: 120, dataType: "string", dataIndx: "address", align: "left", editable: false},
         { title: "Suburb", width: 150, dataType: "string", dataIndx: "suburbcode", align: "center", editable: false },
         { title: "Type", width: 80, dataType: "string", dataIndx: "typeid", align: "center", editable: false },
         { title: "Comments", width: 150, dataType: "string", dataIndx: "description", align: "left", editable: false },
         { title: "Date Ready", width: 80, dataType: "date", dataIndx: "readyDate", align: "center", editable: false },         
         { title: "Time Ready", width: 80, dataType: "string", dataIndx: "readyTime", align: "center", editable: false },
         { title: "Time CloseOff", width: 80, dataType: "string", dataIndx: "closeTime", align: "center", editable: false },
         { title: "Status", width: 80, dataType: "string", dataIndx: "status", align: "center", editable: false },
         { title: "<font color='Red'><b>*MUSTDO</b></font>", width: 40, dataType: "string", dataIndx: "mustdo", align: "center", editable: false }
         
        ],
      flexHeight: true,
      resizable: true,
      sortable: false,
      editable: false,
        width: "auto",
      //height: 150,


Also question:

If you have to do some further editing based on JSON after Javascript validations (once you click Update button), how can you leave the row in Update mode after any alerts about any other validations that took place on the database (web service).
If I click the Update it return the error but I don't know how to leave the Update button on in that row which has the problem?

7
Can you be a bit more specific with a bit of code on what you mean by initialisation of the grid?

Which event?

Can you give me an example of how to reuse the data since it is coming from a JSON query?

8
Hi

MY PayPAL transaction id xxxx180S (Mainstream NZ Ltd).

When you tab in inline editing and you have a select and you don't wait until it is visible the focus goes out of the grid.
The following code is the JSON function on editor init: selectTypes.

// ---------------------
   // Select Freight Types
   // ---------------------
   var selectTypes = function (ui) {
      $inp = ui.$cell.find("select");
      $grid = $(this);
      //alert(ui.cellData);
      //console.log($inp);
      //var dataIndx = ui.dataIndx;
      url = "https://rest.mainstream.co.nz:9191/MAINTEST/subroutine/WEBUSRUPD";
      var params = new Object();
      params.user = user;
      params.userdetin = "0";
      params.mode = "ENQ";
      $.support.cors = true;
      $.ajax({
         type: "POST",
         dataType: 'json',
         data: JSON.stringify(params),
         url: url,
         contentType: "application/json; charset=utf-8",
         beforeSend: function (xhr) {  //MNS
               xhr.setRequestHeader("Authorization",
                        "Basic d2VidXNlcjptNCR0M3I=");
                }, //MNS
         success: function (pdata) {
            var s1 = pdata.msg.msgSeverity,
               s2 = pdata.msg.msgCust,
               s3 = pdata.msg.msgMain;
            if (s1 == "F") {
               alert(s3);
            } else {
               console.log(s1 + " " + s3);
            }
            var seldet = [];
            var seldef = "";
            $(pdata.svs.jobt).each(function (val) {
               var opt = $('<option />');
               if (this.jobTyp == ui.cellData) {
                  // this is the default option so set the 'selected' attribute
                  opt.attr('value', this.jobTyp).text(this.jobDesc);
                  opt.attr('selected', 'selected');
               }
               else {
                  opt.attr('value', this.jobTyp).text(this.jobDesc);
               }
               $inp.append(opt);
            });
         },
         error: function () {
         // constitutes some error from the Web Service
            console.log("WEBUSRUPD failed");
         }
      });
   };

9
ParamQuery Pro Evaluation Support / Set default value for select list
« on: September 02, 2014, 11:12:26 am »
Hi

How can you set the default value that has been set up in the grid column so that in EDIT mode if the column has an editor "select" that the default equivalent description is displayed first.

ie the select has a text/value pair, the text is displayed and once selected the value is repopulated in the cell.

eg initially the value may be "PU" which denotes "PICKUP".
I want the "PICKUP" to display in the select list by default as the first one.

Thanks

10
Hi

I am having a problem with autocomplete in a secondary (child) grid that comes from an external source and needs to be stored prior to usage in child grid.
How can I store it and use it later when the grid control is invoked.
The initial AJAX/JSON is done on entry into the page which gets data for multiple autoCompletes and selects (only once).

I have looked at your example with following code and am not sure how to get it to work for the situation I describe.
It is getting into this function but not setting up the source: attribute properly.

  var autoCompleteEditor = function (ui) {
        var $inp = ui.$cell.find("input");
 
        //initialize the editor
        $inp.autocomplete({
            source: (ui.dataIndx == "books" ? books : "/pro/demos/getCountries"),
            selectItem: { on: true }, //custom option
            highlightText: { on: true }, //custom option
            minLength: 0
        }).focus(function () {
            //open the autocomplete upon focus               
            $(this).autocomplete("search", "");
        });
    }

Also when you refresh the child grid ViewandData how can some of the same data also present in the primary grid (current row) be refreshed at the same time?

ie some data in child grid is editable and this needs to be immediately propagated to primary grid view on Update click.


Regards

Nick.


Pages: [1]