Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DOMGrid - Population and Use

    Is there a working example of the DOMGrid component available somewhere? Reading various forum posts, I've been able to somewhat piece this together... but it isn't working as I'd expect. With the code below I am able to retrieve the XML from my server without issue, however populating the DOMGrid yeilds an object containing only <></>. Am I missing something here?

    Code:
    this.myDOMGrid = isc.DOMGrid.create({
                name: "myDOMGrid",
                parent: this,
                showResizeBar: true,
                canEdit: false,
                showFilterEditor: false,
                autoFetchData: false,
                height: "95%",
                                
    	        fetchXML: function(criteria){
    	        	var url = "url_to_my_data";
    	        	
    	        	var params = {
    	        		OUTPUT_FORMAT: 'XML',
    	        		OPERATION_TYPE: 'fetch'
    	        	};
    	        	
    	        	params = isc.addProperties({}, criteria, params);
    	        	
    	        	var RPCRequest = isc.RPCRequest.create({
    	        			httpMethod: 'POST',
    	        			params: params
    	        	    });
    	        	
    	        	callback = {target: this, methodName: "populateXML"};
    	        	
    	        	isc.XMLTools.loadXML(url, callback, RPCRequest);
    
    	        }, 
    	        
    	        populateXML: function(xmlDoc, xmlText){
    	        	this.setRootElement(xmlDoc);
    	        }
            
            });
    Also tried using xmlText - same result.

    Code:
     populateXML: function(xmlDoc, xmlText){
    	        	this.setRootElement(xmlText);
    	        }
    I'm using SmartClient 6.5.1

    #2
    What is the XML data you are using?

    Comment


      #3
      The XML is criteria driven, but here is a sample:

      Code:
      <data><record><TRIMID>1217</TRIMID><NAME>17 Inch Tire Option</NAME><FITMENTOPTION><FITMENTOPTIONID>1532</FITMENTOPTIONID><NAME>Standard</NAME><FITMENT><FITMENTID>3065</FITMENTID><CARID>53673</CARID><POSITION>F</POSITION><GROSSWEIGHT>5732</GROSSWEIGHT><OEWHEELWIDTH>7.5</OEWHEELWIDTH><OEWHEELDIAMETER>17</OEWHEELDIAMETER><OEWHEELOFFSET>41</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>45</OETIREASPECT><OETIREWIDTH>225</OETIREWIDTH><OETIREINFLATION>38</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>90</OELOADINDEX><OELOADRATING></OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>Z</OESPEEDRATING><OETIRESIZE>225/45ZR17</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>24.97</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT><FITMENT><FITMENTID>3066</FITMENTID><CARID>53674</CARID><POSITION>R</POSITION><GROSSWEIGHT>5732</GROSSWEIGHT><OEWHEELWIDTH>8.5</OEWHEELWIDTH><OEWHEELDIAMETER>17</OEWHEELDIAMETER><OEWHEELOFFSET>50</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>40</OETIREASPECT><OETIREWIDTH>245</OETIREWIDTH><OETIREINFLATION>30</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>91</OELOADINDEX><OELOADRATING></OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>Z</OESPEEDRATING><OETIRESIZE>245/40ZR17</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>24.72</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT></FITMENTOPTION></record><record><TRIMID>1218</TRIMID><NAME>18 Inch Tire Option</NAME><FITMENTOPTION><FITMENTOPTIONID>1533</FITMENTOPTIONID><NAME>Standard</NAME><FITMENT><FITMENTID>3067</FITMENTID><CARID>54777</CARID><POSITION>F</POSITION><GROSSWEIGHT>4940</GROSSWEIGHT><OEWHEELWIDTH>7.5</OEWHEELWIDTH><OEWHEELDIAMETER>18</OEWHEELDIAMETER><OEWHEELOFFSET>47</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>40</OETIREASPECT><OETIREWIDTH>225</OETIREWIDTH><OETIREINFLATION>35</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>88</OELOADINDEX><OELOADRATING></OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>Y</OESPEEDRATING><OETIRESIZE>225/40ZR18</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>25.09</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT><FITMENT><FITMENTID>3068</FITMENTID><CARID>54778</CARID><POSITION>R</POSITION><GROSSWEIGHT>5292</GROSSWEIGHT><OEWHEELWIDTH>8.5</OEWHEELWIDTH><OEWHEELDIAMETER>18</OEWHEELDIAMETER><OEWHEELOFFSET>50</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>35</OETIREASPECT><OETIREWIDTH>255</OETIREWIDTH><OETIREINFLATION>32</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>90</OELOADINDEX><OELOADRATING></OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>Y</OESPEEDRATING><OETIRESIZE>255/35ZR18</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>25.03</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT></FITMENTOPTION></record><record><TRIMID>1219</TRIMID><NAME>Standard</NAME><FITMENTOPTION><FITMENTOPTIONID>1534</FITMENTOPTIONID><NAME>Standard</NAME><FITMENT><FITMENTID>3069</FITMENTID><CARID>53672</CARID><POSITION>F</POSITION><GROSSWEIGHT>5732</GROSSWEIGHT><OEWHEELWIDTH>7</OEWHEELWIDTH><OEWHEELDIAMETER>17</OEWHEELDIAMETER><OEWHEELOFFSET>46</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>50</OETIREASPECT><OETIREWIDTH>205</OETIREWIDTH><OETIREINFLATION>38</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>93</OELOADINDEX><OELOADRATING>RF</OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>V</OESPEEDRATING><OETIRESIZE>205/50R17</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>25.07</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT><FITMENT><FITMENTID>3070</FITMENTID><CARID>53672</CARID><POSITION>R</POSITION><GROSSWEIGHT>5732</GROSSWEIGHT><OEWHEELWIDTH>7</OEWHEELWIDTH><OEWHEELDIAMETER>17</OEWHEELDIAMETER><OEWHEELOFFSET>46</OEWHEELOFFSET><OETIREFENDERGAP></OETIREFENDERGAP><OETIREASPECT>50</OETIREASPECT><OETIREWIDTH>205</OETIREWIDTH><OETIREINFLATION>38</OETIREINFLATION><OEWHEELHUBBORE>72.6</OEWHEELHUBBORE><OEBOLTPATTERN>5X120</OEBOLTPATTERN><OEHEX>17mm</OEHEX><OETHREAD>12x1.50b</OETHREAD><OELOADINDEX>93</OELOADINDEX><OELOADRATING>RF</OELOADRATING><OETIRECODE></OETIRECODE><OESPEEDRATING>V</OESPEEDRATING><OETIRESIZE>205/50R17</OETIRESIZE><WHEELKITCODE>L</WHEELKITCODE><OETIREDIAMETER>25.07</OETIREDIAMETER><MINWHEELWIDTH></MINWHEELWIDTH><MAXWHEELWIDTH></MAXWHEELWIDTH></FITMENT></FITMENTOPTION></record></data>

      Comment


        #4
        Not sure that's a great way to show tire guide data but it can be done. Try this:
        Code:
        populateXML: function(xmlDoc, xmlText){
            this.setRootElement(xmlDoc.documentElement);
        }

        Comment


          #5
          Perfect. That's what I was missing. Thanks!

          Comment

          Working...
          X