I have simple code in my javascript of an aspx page:
var activeRow= igtbl_getActiveRow("gridName");
I get the error igtbl_getActiveRow is not defined.
I am using Infragistics4.WebUI.UltraWebGrid.v11.1.
Please help
I would try to first get the grid and then the row.
var grid = igtbl_getGridById('gridId');
var activeRow = grid.getActiveRow();
or
var activeRow = igtbl_getGridById('gridId').getActiveRow();
Related
Firstly, I'm using google apps script
I get an text body and I want to replace placeholder with variables in a sheet, I get a variable in my sheet and i want to replace it with regex but it's not working
it's working with a variable that i just set but not with an value that i get in a sheet... I don't know why...
function replaceInBody() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var lastLigne = sheet.getLastRow()
var lastColumn = sheet.getLastColumn()
var firstLigne = sheet.getRange(1,1,1,lastColumn).getValues();
var newBody
Logger.log('firstLigne: %s', firstLigne)
var data
var bodyTest = 'blablabla {name} blablabla {var1} blabla'
Logger.log('bodyTest: %s', bodyTest)
var notwork = firstLigne[0][2]
var work = 'name'
Logger.log('notwork: %s', notwork) // finally it's work by rewriter the code
Logger.log('work: %s', work)
Logger.log('**')
Logger.log(new RegExp("{"+ work +"}", 'g'))
newBody = bodyTest.replace(new RegExp("{"+ notwork +"}", 'g'), 'changed')
Logger.log('newBody: %s', newBody)
newBody = bodyTest.replace(new RegExp("{"+ work +"}", 'g'), 'changed')
Logger.log('newBody: %s', newBody)
}
```
just my text is not change with notwork variable but it's the same variable... // finally it's work by rewriter the code but I don't know my first mistake thanks to all of you :p
You need to change your replace() method to:
var regex1 = 'blablabla {name} blablabla {name} blabla';
console.log(regex1.replace(/name/g, 'Changed'));
This will find every appearance of "name" and change it. You can take a look at the method's documentation to see how to work with these more simply.
I'm new to Visual Studio extensions. I'm developing a Menu Command extension to add a using directive to my class. So far, I could successfully create a new Document object containing the changes:
var syntaxTree = await sourceDocument.GetSyntaxTreeAsync();
var unitRoot = syntaxTree.GetCompilationUnitRoot();
var qualifiedName = SyntaxFactory.ParseName("MyApp.Utilities"); // using MayApp.Utilities
var usingDirective = SyntaxFactory.UsingDirective(qualifiedName);
unitRoot = unitRoot.AddUsings(usingDirective);
var newDocument = sourceDocument.WithSyntaxRoot(unitRoot);
The problem is it doesn't reflect the changes back to the source code (or workspace if it's correct term).
Any idea and suggestion is appreciated.
I have an issue using a text variable from a response body and inserting into a request without the text qualifiers.
I'm trying this:
var data = JSON.parse(responseBody);
postman.setGlobalVariable("basketid", responseBody);
This is the response
"14b5f921-78d9-4ab2-a5a0-828f00fcf63a"
When I look at the basketid variable the text qualifiers are still there which mean that when I call
{{url}}/api/{{basketid}}
I get an error.
Do anyone know of a way to save the variable without text qualifier?
The following worked for me:
var _token = responseBody.slice(1,-1);
pm.globals.set("token", _token);
If you are getting "14b5f921-78d9-4ab2-a5a0-828f00fcf63a" as it is in global environment as you said, you can use eval:
var jsonObj = JSON.stringify(responseBody);
var setObj=eval("("+jsonObj+")");
postman.setGlobalVariable("basketid",setObj);
I ran into the same issue today while trying to store my token and this is what worked for me:
var data = JSON.parse(responseBody);
postman.setGlobalVariable("token", data.token);
don't know if block helper is the right name but hope you get the point.
In Ember 1.8.0-beta.2 i can not do
<img src="{{url}}">
Chrome gives me:
Uncaught TypeError: Cannot read property 'parentNode' of null
Uncaught TypeError: Cannot set property 'profileNode' of undefined
And Firefox gives me:
TypeError: ref is null
var parent = ref.parentNode;
The error comes from vendor.js
hydrateMorphs: function () {
var childViews = this.childViews;
var el = this._element;
for (var i=0,l=childViews.length; i<l; i++) {
var childView = childViews[i];
var ref = el.querySelector('#morph-'+i);
var parent = ref.parentNode; // This line
childView._morph = this.dom.insertMorphBefore(parent, ref);
parent.removeChild(ref);
}
}
I know that i simply can do a handlebars helper to output the img tag with right src but i want to be able to use the {{url}} to set a divs background property aswell.
(the url property is just a simplified version. In my app i have a helper thats takes an array of images and maxWidth to to give me the best picture depending on the width. But {{url}} does not work either)
forgot that I just can use unbound:
<img src="{{unbound url}}">
You can't use that syntax in ember handlebars. The accepted one is bind-attr.
Usage examples: http://emberjs.com/guides/templates/binding-element-attributes/
More info: http://www.emberist.com/2012/04/06/bind-and-bindattr.html
I need to select links with a specific format of URLs. Can I use sizzle to evaluate a link's href attribute against a regular expression?
For example, can I do something like this:
var arrayOfLinks = Sizzle('a[HREF=[0-9]+$]');
to create an array of all links on the page whose URL ends in a number?
Give this a try. I've attempted to convert the jQuery regex selector that Kobi linked to into a Sizzle selector extension. Seems to work, but I haven't put it through a lot of testing.
Sizzle.selectors.filters.regex = function(elem, i, match){
var matchParams = match[3].split(',', 2);
var attr = matchParams[0];
var pattern = matchParams[1];
var regex = new RegExp(pattern.replace(/^\s+|\s+$/g,''), 'ig');
return regex.test(elem.getAttribute(attr));
};
In this case, your example would be written as:
var arrayOfLinks = Sizzle('a:regex(href,[0-9]+$)');