jQWidgets Forums

Forum Replies Created

Viewing 14 posts - 46 through 59 (of 59 total)
  • Author
    Posts
  • in reply to: jqxInput auto complete jqxInput auto complete #55732

    EricK
    Participant

    Hey Peter,
    That’s what I was going to do. But I am not sure how to handle the formatData function.
    I call the same php file and use the data:name (data:company), (data:status) to determine which sql to process.
    How can I change parameter name. Here is the code:

    
    var dataAdapter = new $.jqx.dataAdapter
      (
        { 
          datatype: "json",
          datafields: [
          { name: 'name'},
          { name: 'id'}	
          ],
          id: 'id',
          url: 'listdata.php'
          },
          {
           	autoBind: true,
            formatData: function (data) {
              data.company = query;
              return data;
            },
            loadComplete: function (data) {
              if (data.length>0){
                response($.map(data, function (item) {
                    return {
                    label: item.name,
                    value: item.id
                    }
                }));                                
    	  }
         	}
         }
    );
    

    Thanks again
    EricK

    in reply to: jqxInput auto complete jqxInput auto complete #55729

    EricK
    Participant

    Hey Peter,
    I guess, I assumed it would load the data if I had the displayMember and valueMember defined.
    So, yes I will need to have the loadComplete.

    I only wanted to create a shorter method to the process. Since, I will have up to 10 inputs on a form that will call a php.

    Thanks again,
    Eric

    in reply to: jqxInput auto complete jqxInput auto complete #55723

    EricK
    Participant

    Thanks Peter,
    I was trying to create a shorter version.
    Do I have to use the loadComplete function or can this be automatic?

    Eric


    EricK
    Participant

    Hello again.

    Quick question.
    Can I use the 100% for both width and height when initializing nav bar?

    Thanks for all of your assistance.
    EricK

    in reply to: bindingComplete bindingComplete #54922

    EricK
    Participant

    Howdy Dimitar,

    I am new too jquery so please confirm. Will the following re-set the source?

    
    $('#calendar').on('change viewChange', function (event) {
         date = event.args.date;
         if (event.type == 'change') {
    	cdate = formatDate(date,'yyyy-MM-dd');
    	source.data = {actdate:cdate};
    	dataAdapter = new $.jqx.dataAdapter(source);
    	$("#events").jqxListBox({ source: dataAdapter });
    					
         }
    });
    
    in reply to: gridEditorValue gridEditorValue #54593

    EricK
    Participant

    Answered my question.

    var gridEditorValue = function (row, cellValue, editor) {
    var rv = editor.jqxDropDownList(‘getSelectedItem’);
    if (row==8){
    return {id:editor.val(),name:rv.label};
    }else{
    return editor.val();
    }

    }


    EricK
    Participant

    Hi Peter,
    Last question regarding the On success.

    call commit(true,newRowID)

    can I pass other fields or only the newRowID?

    ex. commit(true,newRowID, field1, field2…)


    EricK
    Participant

    Hi Peter,

    Yes, I would implement that technique if it worked correctly. If you can give me an example of this working. I would use it.
    I have your example which I modified to recreate the issue. How can I send it to you.

    Thanks,
    Eric


    EricK
    Participant

    Hi everyone,

    I have a solution to the problem. You will need to process the ajax call before the add row function.
    Sample:

    
    $("#addrowbutton").bind('click', function () {
           //var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;
           //var datarow = generaterow(rowscount + 1);
           var data = "insert=true";
           $.ajax({
            dataType: 'json',
            url: 'datatest.php',
            data: data,
    	cache: false,
            success: function (data, status, xhr) {
    	   // insert command is executed.
    	    $("#jqxgrid").jqxGrid('addrow', null, data);	
    	    }			
    	  }); 
            });
    

    Hopefully this will help with anyone trying to add a row and needs to capture a key value to pass back to the grid.


    EricK
    Participant

    Hi Peter,
    There is something that is performing an auto count when the add row function is called. I have remarked that part of the code out in the index.php. When I perform the add row it fills the EmployeeID with the number 10.

    Here is the returning data from the data.php
    [{“EmployeeID”:”12″,”FirstName”:”Peter”,”LastName”:”Stoev”,”Title”:”Keymaster”,”Address”:”123 Widget Street”,”City”:”New York”,”Country”:”USA”,”Notes”:”Widgets are awsome.”}]

    The add row function is return the row count as a data field.

    The only reason I am trying to get someone to look at this closer is because I will be using the grid for everything I plan on designing. I have done alot of testing with the grid features and have found no problems. This is the only issue, I need to have resolved in order to move forward.


    EricK
    Participant

    Hi Peter,
    Do we have an example of ajax php insert into a database that does not pass any data with the insert?

    If not I could send you the sample I have.

    Eric


    EricK
    Participant

    Hi Peter,
    Ok, the information you provided was very helpful.

    Basically, the filter has no criteria entered. I open the grid with showfilters, the grid is blank with my filter headings.
    Nothing is entered. I select the add function and the grid shows a new row.
    The only data that is returned from the add function is the new record id (generated from the database) and the datafields which are blank.
    The grid should now have a row with the id field populated with a number. I would have thought the new row now has the id when I select it does not.

    Does the grid update itself with the new data automatically or do I have to set each field manually?
    I found out that the grid does not have to be in editmode from your example above.

    From your examples which shows the data fields being populated before the add row is processed and your use of the generatedata.

    in reply to: Add Row with returned db id Add Row with returned db id #53909

    EricK
    Participant

    One other question?
    If the grid is filtered. Does that have an effect on the add row process?

    in reply to: Grayed datetime input Grayed datetime input #51287

    EricK
    Participant

    Sample image of datetime input

Viewing 14 posts - 46 through 59 (of 59 total)